ST. PETERSBURG, Fla. (AP) -- Evan Longoria savored another win-or-go-home victory for the Tampa Bay Rays.
''I think we all understand the stakes. We all understand that we have our backs to the wall. And it seems like those moments have been fueling us,'' the three-time All-Star said Monday night after Jose Lobaton's two-out, ninth-inning homer gave the Rays a 5-4 victory over the Boston Red Sox and renewed hope in the AL division series.
''These are the game that we've really played well in. Although you'd like to be on the other side, maybe we need that now.''
Tampa Bay won when facing elimination for the fourth time in nine days, trimming Boston's lead to 2-1 in the best-of-five matchup. Game 4 is Tuesday night at Tropicana Field, with Jake Peavy starting for the Red Sox against Jeremy Hellickson.
''They have a great team. They never quit. We've seen that ... everyone knows that. We've just got to be one run better than them (Tuesday),'' Boston's Dustin Pedroia said. ''We'll be all right. We'll be fine.''
As he's done so often in his career, Longoria provided the spark that turned a potentially bleak night into a special moment in Rays history.
The only player who's appeared in every postseason game Tampa Bay has ever played homered off Clay Buchholz in the fifth inning. The three-run shot erased a 3-0 deficit and boosted sagging hopes.
We needed that badly, there's no denying,'' manager Joe Maddon said.
''After we saw that ... it's kind of like the energy came back,'' Lobaton added. ''Everybody was kind of like, we've got a chance now.''
Lobaton's solo homer off Koji Uehara landed into the giant fish tank beyond the center-field wall. The Red Sox closer didn't allow a home run in his last 37 regular-season appearances.
''Koji has been tough, man. He's been a really bright spot on that ballclub. To be able to come through in that moment, those are the kind of things that we're going to need to propel us forward,'' Longoria said.
Back home after two weeks on the road, the Rays gave a sellout crowd of 33,675 little to cheer until Longoria homered on his 28th birthday.
Pinch-hitter Delmon Young, who has a penchant for driving home key runs in October, put the Rays ahead 4-3 with an RBI grounder in the eighth.
The Red Sox made it 4-all in the ninth on Pedroia's RBI grounder after closer Fernando Rodney issued a leadoff walk to Will Middlebrooks.
Rodney got the win when Lobaton golfed a low pitch to right-center, ending the 4-hour, 19-minute game. The ball deflected off a fan trying to catch the souvenir and wound up in the 10,000-gallon tank where cownose rays swim around.
Rays manager Joe Maddon said he was studying his lineup when he heard the crack of the bat.
''Look up and the ball is going towards the tank, which nobody hits home runs there. Nobody does. How about that? It's incredible,'' he said.
The last time Uehara gave up a homer was June 30 to Toronto slugger Jose Bautista.
''You don't expect it ... I think that's what makes it a little tougher,'' Red Sox right fielder Shane Victorino said of Lobaton's homer. ''I'll hand the ball to Koji (Tuesday) if we need to. I have all the confidence in him. We look at the positive that we battled back against their closer to tie the game.''
The Rays won three must-win road games in three cities over four days just to get into the division series, so they felt good about their chances of coming back against the Red Sox.
Especially with Alex Cobb on the mound. The right-hander beat Cleveland 4-0 in the AL wild-card game last Wednesday and has been one of the consistent pitchers in the majors since August 2012.
The Red Sox were just as confident about the prospect of closing out the series.
''I'm sure there's an attitude they have nothing to lose and just let it all hang out,'' Boston manager John Farrell said. ''That's what we've been accustomed to for years against the Rays. As I mentioned before the series started, we have tremendous respect for them and we know it will be a very similar game tomorrow night.''
Buchholz, limited to 16 starts this season because of a neck strain that landed him on the disabled list for three months, allowed three runs and seven hits in six innings.
Cobb, pitching on his 26th birthday, yielded three runs and five hits in five innings. Ellsbury scored Boston's first two runs on Ben Zobrist's throwing error in the first and Cobb's wild pitch in the fifth. David Ortiz's fifth-inning RBI single put the Red Sox up 3-0 against the Tampa Bay starter.
The Red Sox remain confident heading into Game 4. This is the ninth time they've won Games 1 and 2 of a postseason series, and seven of the eight previous times they finished the job.
''It's still 2-1,'' Victorino said. ''We're still in the driver's seat. We control our own destiny.''