Updated

St. Petersburg, FL (SportsNetwork.com) - Derek Jeter drove in the winning run in the ninth inning to help the New York Yankees in a 3-2 victory over the Tampa Bay Rays on Saturday in the second of a three-game set.

Martin Prado hit a two-run home run for the Yankees, who snapped a five-game losing streak.

"We really needed this, we need all of them right now," said Jeter. "You're getting down to crunch time now because there's like 40 games left. So we need all the wins we can get."

Shane Greene gave up two runs on seven hits with a walk and 10 strikeouts over six-plus innings in the start. Dellin Betances (5-0) pitched a flawless eighth for the win.

Ben Zobrist and Yunel Escobar each drove in a run for the Rays, who had a three-game winning streak broken. Drew Smyly allowed two runs on four hits in seven innings of starting work.

"I was just taking one batter at a time because they have a good lineup over there," said Smyly. "The have good plate discipline and don't swing at much so they really make you work for it."

Jake McGee (3-1) was on the mound to start the ninth and deflected a grounder up the middle by Brett Gardner that Logan Forsythe fielded. Forsythe hurried his throw to first to try and beat Gardner, but his throw was off the mark and it went into the dugout, allowing Gardner to move to second, Jeter followed with a single to right for the go-ahead run.

David Robertson tossed a 1-2-3 ninth for his 32nd save of the season.

The Yankees grabbed the lead in the second inning as Chase Headley worked a two-out walk and Prado followed with a big blast over the wall in left for a 2-0 lead.

Tampa left men on base in each of the first three innings, and didn't threaten again until the sixth.

With one out, Matt Joyce singled and Evan Longoria followed with a base hit. Following a line out from James Loney, Escobar singled home Joyce to make it a 2-1 game.

In the seventh, Curt Casali was hit by a pitch and Kevin Kiermaier reached base on an infield single to chase Greene from the game.

Shawn Kelley took the mound and a sacrifice bunt from Desmond Jennings moved the runners up a bag before Zobrist grounded out to score Forsythe, who came on to pinch-run from Casali, and tie the game.

Game Notes

Before the game, the Rays recalled infielder Vince Belnome from Triple-A Durham and optioned pitcher Brandon Gomes to Durham ... Tampa still leads the season-series, 8-4 ... Tampa left seven men on base as the team was 1-for-9 with runners in scoring position.