LOS ANGELES -- With the Dodgers having twice erased their lead, the Tampa Bay Rays were staring at a third straight loss and a precipitous drop in the AL wild-card race.
But they tied it up in the bottom of the ninth inning and got a home run from Austin Meadows leading off the 11th to rally for an 8-7 victory that prevented the New York Yankees from clinching the AL East title Wednesday night.
"We had a ton of fight," Rays left fielder Tommy Pham said. "Everyone saw it."
Tampa Bay remained two games behind Oakland for the top wild card and a half-game ahead of Cleveland for the second spot.
"They don't get frustrated in the moment, they understand the task at hand, and they rose up to it and had some big, big at-bats," Rays manager Kevin Cash said of his team.
Meadows slugged his 32nd homer off Josh Sborz (0-1), and Ji-Man Choi's sacrifice fly tacked on an insurance run after the Rays had rallied for two runs off Los Angeles closer Kenley Jansen in the ninth.
"Didn't have it today," said Jansen, who has four blown saves in his last eight chances. "Just got to move on. Can't let this one hold you back."
Pham had a career-high five hits for the Rays, who ended a two-game skid.
"Anytime you get five hits you need some luck, and I had some luck," Pham said.
Tampa Bay took advantage of another collapse by Jansen, who had shown improvement lately. He got booed off the field after giving up Choi's RBI single and Travis d'Arnaud's sacrifice fly that tied it 6-all.
The teams combined to use 18 pitchers, two more than on Tuesday.
"Hopefully we never have to play them again in September," Dodgers slugger Cody Bellinger said. "Just no flow to the game."
Colin Poche (5-5) got the win. Fairbanks earned his second save.
"That's a big win for us," Fairbanks said. "I don't think there's any quit in the offense."
Bellinger slugged his 45th homer -- and first since Sept. 2 -- in the eighth, ending the Dodgers' three-game skid without a home run. It hit the right field foul pole and extended the lead to 6-4.
"We've still got to fight for home-field (advantage)," Bellinger said. "That's on our mind."
Dustin May, the Dodgers' seventh pitcher, put the potential tying and go-ahead runs on in the seventh with consecutive hits by Pham and Nate Lowe. But then May struck out Choi and d'Arnaud, and retired Joey Wendle to end the threat.
The Dodgers led 2-1 on Max Muncy's two-run double in the second.
The Rays tied it 3-all in the fifth on Pham's two-run double and took a 4-3 lead in the sixth on pinch-hitter Jesus Aguilar's RBI single, with Willy Adames scoring on Bellinger's throwing error in center field.
For the second straight game, the Dodgers made a late change to their starting pitcher. RHP Casey Sadler got the nod instead of RHP Tony Gonsolin. Sadler tossed two-thirds of an inning. Gonsolin worked in relief, which is what he'll do in the postseason if he makes the roster, so the team wants to use him in that role down the stretch. The same thing happened Tuesday when Caleb Ferguson replaced scheduled starter Ross Stripling, who pitched in relief, also his likely postseason role.
Dodgers: LHP Rich Hill (left knee strain) will throw to hitters Friday and start Tuesday at San Diego. ... 3B Justin Turner is recovering from a sprained left ankle, but no return date has been set. "When he does come back, I want to be confident he can sustain it," manager Dave Roberts said.
Rays: After an off day, RHP Charlie Morton (15-6, 3.16 ERA) goes for his career-high 16th victory Friday against Boston.
Dodgers: LHP Clayton Kershaw (14-5, 3.05) pitches Friday at home against Colorado. He is 22-8 with a 3.41 ERA in 41 career starts versus the Rockies.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Astros and Yankees to feature bullpens in ALCS Game 6
Instead of using starters Gerrit Cole and Luis Severino on short rest, the Astros and Yankees will rely on their bullpens to get through Game 6 of the ALCS, managers AJ Hinch and Aaron Boone said Friday night.
Verlander fighting through Game 5 was 'too little, too late'
Justin Verlander credits his playoff experience for settling down after a four-run first inning, but admits his mistakes ultimately determined the game.
Hicks: Yanks wanted to throw 1st punch in Game 5
Aaron Hicks speaks on his and DJ LeMahieu's home runs in the first inning and James Paxton's impressive win in Game 5 of the ALCS.
Paxton encouraged Boone to let him finish the 6th
James Paxton credits his focus for earning a Game 5 victory, and admits he encouraged Aaron Boone to leave him in during a sixth-inning mount visit.
LeMahieu, Hicks lift Yanks over Astros, close to 3-2 in ALCS
DJ LeMahieu and Aaron Hicks stunned Justin Verlander with first-inning home runs, James Paxton made the early lead stand up and the New York Yankees beat Houston 4-1 Friday night, cutting the Astros' lead in the AL Championship Series to 3-2.
Verlander settles down with 9 K's after 4-run 1st
After allowing four runs on two home runs in the first inning of Game 5, Justin Verlander rebounds with nine strikeouts over seven innings.