ST. PETERSBURG, Fla. (AP) -- Evan Longoria has broken out of his slump in a big way.
Longoria hit a go-ahead two-run homer in the eighth inning and the Tampa Bay Rays beat the Texas Rangers 5-4 on Tuesday night.
"He hit it well enough," Rays manager Joe Maddon said. "I just didn't know if it was far enough."
With the Rays trailing by a run, Longoria gave Tampa Bay the lead with his two-out drive off Arthur Rhodes (3-3) after Johnny Damon reached on an opposite-field bloop single to left that deflected off the glove of shortstop Elvis Andrus .
Texas manager Ron Washington said he made a mistake by not having closer Neftali Feliz ready to face the Rays' slugger.
"I should have had him up after I brought Arthur in," Washington said. "Just in case he didn't get Damon, I should have had him going. I thought about it, but didn't act on it. I'll take the blame for it all."
Longoria was back hitting fourth after three games as the leadoff man, a move designed to help him work out of an offensive funk that saw him get just six hits in 45 at-bats. The Rays' All-Star third baseman went 2 for 3 with a walk on Tuesday after getting five hits in 11 at-bats during the previous three games.
"I got some results in that role," Longoria said. "Any time you get results and have some success, you build confidence. When you start building back that confidence you haven't had, it makes it easier. To get those results, and get back into the four-spot and have an opportunity to help the team win a game and come through, it just adds to your confidence."
Nelson Cruz scored from third on a wild pitch by Joel Peralta (2-3) with two outs in the eighth as the Rangers took a 4-3 lead. Peralta had replaced J.P Howell after the left-hander gave up consecutive singles to begin the inning.
Sean Rodriguez and Matt Joyce also homered for the Rays. Alex Cobb allowed three runs and four hits over 6 1-3 innings in his second career major league start.
Joyce, who entered with a major league-best .368 batting average, pulled Tampa Bay even at 3 on a two-out, two-run shot off Texas starter C.J. Wilson in the seventh.
"I missed my spot. If I hit my spot I don't think he's going to do much with it," Wilson said. "I'm really disappointed with myself. I feel like I cost us the game for us. It's frustrating."
Longoria started the seventh with an infield single.
"He's a big part of the offense," Joyce said. "When he's going well we're going to put up some runs."
Kyle Farnsworth pitched the ninth for his 10th save.
Wilson gave up three runs, three hits, four walks and struck out 10 in 6 2-3 innings. He took a one-hitter into the seventh.
The Rangers, who had won in three in a row, went ahead 2-1 during the top of seventh on Ian Kinsler 's run-scoring single off Cobb, who was recalled from Triple-A Durham on Monday. Michael Young extended the lead later in the inning to 3-1 with an RBI single against Howell.
Adrian Beltre put the Rangers up 1-0 with a third-inning RBI single.
Rodriguez, one day after making three errors at shortstop, tied it at 1 during the third on his second homer this season and first since April 5.
Wilson struck out five in a row after Rodriguez's shot, and made a barehanded grab on Justin Ruggiano 's inning-ending grounder in the fifth. The left-hander was facing Tampa Bay for the first time since allowing two hits over 6 1-3 scoreless innings in Game 2 of last year's ALDS.
After hitting at least four homers in each of their last three games, the Rangers did not go deep Tuesday.
Andrus was out of the lineup with a sore left foot, but fouled out to end the eighth as a pinch hitter.
Notes: Tampa Bay RHP Jeff Niemann (strained lower back) is set to make the first of three scheduled minor league rehab starts Friday night with Class-A Charlotte. ... Washington said a final decision on whether Matt Harrison (index finger blister) will make his next scheduled start Thursday has not been made. The left-hander threw off a bullpen mound Tuesday.