Updated

Pinch-hitter Sean Rodriguez came through with a tie-breaking RBI single in the top of the eighth inning as the Tampa Bay Rays rallied for a much-needed 4-1 decision over the Seattle Mariners at Safeco Field.

Tampa Bay trailed 1-0 after seven frames before scoring three times in the eighth to snap a three-game skid that included losses in the first two tests of this series. James Loney, who finished 3-for-4, delivered an RBI double off Yoervis Medina (4-5) in front of Rodriguez's go-ahead hit.

The win, only the Rays' third on their just-completed 10-game West Coast trip, put Tampa Bay two games ahead of both Baltimore and Cleveland for the AL's second wild card spot. Both the Orioles and Indians lost on Sunday.

"Every team out there's gone through bad moments this year. Ours is just occurring right now. A lot of it is it's a tough trip. It's a tough trip," Rays manager Joe Maddon said.

Jake McGee (4-3) received the victory after recording the final two outs of the seventh in relief of Matt Moore, who yielded just Kendrys Morales' solo homer and four other hits over 6 1/3 innings.

Mariners starter Erasmo Ramirez did not allow a run over six-plus innings of work, giving up four hits and four walks while fanning five.

"I loved his aggressiveness early in the game and he was able to hang on to it and sustain it," Seattle manager Eric Wedge said.

The Rays generated little against a sharp Ramirez over the game's opening six innings, then failed to score on a bases-loaded, none-out opportunity while down 1-0 in the seventh. Kelly Johnson drew a walk and Jose Lobaton singled to end Ramirez's day before reliever Charlie Furbush walked Wil Myers to fill the sacks.

Furbush atoned for the free pass by getting pinch-hitter Delmon Young to bounce into a 1-2-3 double-play, however, and Ben Zobrist flied out harmlessly to right to end the threat.

Tampa Bay finally broke through in the eighth, though.

Medina hit leadoff batter Evan Longoria with a pitch and then walked Luke Scott in front of Loney's shot into the right-field corner that brought home the tying run. Rodriguez followed by greeting Oliver Perez with a single up the middle that plated pinch-runner Desmond Jennings, with Loney also scoring on the play after Seattle's Abraham Almonte mishandled the ball in center field.

The Rays added an insurance run when Zobrist singled and came around on a Jennings double in the top of the ninth, and Fernando Rodney tossed a perfect bottom of the inning to record his 33th save of the year.

Save for serving up Morales' long homer into the middle deck in left that began the bottom of the second, Moore was outstanding. Beginning with the final out of the third inning, he retired 11-of-12 hitters until permitting Dustin Ackley's one-out single in the seventh that prompted Rays skipper Joe Maddon to summon McGee into the game.

Game Notes

Zobrist went 2-for-5 with a run scored ... Tampa Bay ended 4-for-10 with runners in scoring position, while the Mariners were 0-for-6 in such situations ... Moore is 7-0 with two no-decisions since his last loss, which came against Kansas City on June 14 ... Seattle was aiming for its first series sweep of three or more games of the Rays since Aug. 7-9, 2006.