ST. PETERSBURG, Fla. -- Jason Bourgeois came up in the right place at the right time Wednesday night, with the bases loaded in the bottom of the ninth inning for the Tampa Bay Rays, who needed a win to break a six-game losing streak.

The 31-year-old backup outfielder delivered his first hit for the Rays, an RBI single to cap a two-run rally that lifted Tampa Bay over the Seattle Mariners 5-4.

"No outs, bases loaded, that's like a hitter's dream to be in that situation with the game on the line," said Bourgeois, who had entered the game as a pinch(equals)runner in the eighth. "I was looking for pitch up and out over the plate. I got it and took advantage of it."

The Rays trailed 4-3 when Ben Zobrist opened the ninth with a triple off the top of the right-field wall against rookie Danny Farquhar (0-1).

Matt Joyce singled to tie it, Evan Longoria doubled and Wil Myers was intentionally walked to load the bases. Bourgeois, playing in only his fourth game after being called up from Triple-A Durham on Aug. 6, singled to right over the Mariners' drawn-in outfield.

"We've just been waiting on that big moment. I think this is going to keep us going a little bit," he said. "It seems to open a lot and take some (pressure) off the pitcher who's starting for us tomorrow."

The win broke the Rays' longest losing streak since the first six games of the 2011 season, and it marked only their third win in 43 games this season in which they trailed after eight innings.

"It's almost never easy," said a relieved manager Joe Maddon. "When things are getting a little bit awkward, it normally takes an awkward game to win, in order to get you back on task, on track."

Joel Peralta (2-5) pitched one inning. Farquhar didn't retire any of the five batters he faced.

Myers' two-run homer, his ninth of the season, cut Seattle's lead to 4-3 in the sixth after a leadoff double by Longoria.

Rookies Brad Miller and Nick Franklin drove in three runs with back-to-back extra-base hits in the fifth to give the Mariners a three-run lead.

David Price failed in his bid to become the first Rays starting pitcher to win this month. Price pitched seven innings, giving up four runs on five hits while striking out seven. All four Mariner runs came on two-out hits.

"I wasn't able to make pitches. That's what I've been doing, but it's what I didn't do as well tonight, especially with two outs, and that's how innings start," Price said. "Our team winning is the biggest thing right now. To come from behind against Farquhar, who slammed the door on us yesterday, that's huge."

Kendrys Morales drove in Seattle's first run with a single in the first. With two outs, Kyle Seager was hit by a pitch, stole second, moved to third on a wild pitch and scored on Morales' hit.

Facing the Mariners for the first time in his 138th major league start, Price then retired 12 straight before walking Dustin Ackley with two out in the fifth. Humberto Quintero reached on an infield chopper, Miller tripled into the left-field gap and Franklin doubled.

Mariners starter Aaron Harang, pitching in his 33rd different major league ballpark, gave up only three singles until the sixth, when the Rays opened with four straight hits and finished him.

Game notes
RHP Alex Cobb will start for the Rays on Thursday, pitching in the majors for the first time since being struck on the right ear by a line drive exactly two months ago. ... Rays LHP Matt Moore threw 55 pitches in a bullpen session Wednesday, but the All-Star pitcher is not satisfied that he is 100 percent and will not come off the disabled list this weekend. Moore plans to throw again Sunday, but Maddon said it will not be off a mound. ... Rays starting pitchers are 0-6 in their last 11 games after going 16-2 in the preceding 21 games. . . . Rays CF Desmond Jennings, who is on the disabled list with a fractured left middle finger, hit off a tee. He is eligible to come off the DL on Monday . . . Farquhar had recorded the first five saves of his career in his preceding five appearances for the Mariners. . . . The umpire crew of Wally Bell, Marvin Hudson, Marty Foster and Jordan Baker visited the All Children's Hospital as part of the Umps Care Charities Blue for Kids program.