Victor Martinez drew a tiebreaking bases-loaded walk during a three-run 11th inning, and the Tigers beat the Rays 8-6 on Tuesday night.
Ian Kinsler opened the 11th with a triple off Grant Balfour (1-5), a flare to right that got past a diving Kevin Kiermaier. Torii Hunter walked and Miguel Cabrera was intentionally walked before Martinez got his free pass.
"We did what we had to do," Hunter said. "Had good at-bats, and we came through with some runs."
Hunter scored on Jeff Beliveau's wild pitch, and Bryan Holaday added a sacrifice fly that gave Detroit an 8-5 lead.
Jim Johnson (5-2) worked out of a two-on, two-out jam in the 10th. Joe Nathan gave up Evan Longoria's RBI single in the 11th before getting his 26th save.
The Tigers, second in the American League wild-card chase, won for the fifth time in 13 games.
The game took 4 hours, 42 minutes.
James Loney homered for the Rays, who had a club-record stretch of 13 consecutive games holding opponents to four runs or fewer end.
Detroit starter Max Scherzer came up short in his bid to become the AL's first 15-game winner when Joba Chamberlain gave up an eighth-inning sacrifice fly to Vince Belnome that tied it at 5.
Scherzer allowed four runs and four hits over seven innings. The right-hander held Tampa Bay scoreless on one hit over his final five innings.
"Both Max and the offense picked it up as the game went on," Tigers manager Brad Ausmus said.
J.D. Martinez hit a solo homer that put the Tigers up 5-4 in the eighth. Rajai Davis had a sixth-inning game-tying RBI single off Chris Archer, who gave up four runs and five hits in 5 2/3 innings.
The Tigers pulled within 4-3 in the fifth, thanks in part to a video review. After Kinsler walked with the bases loaded and Hunter hit a run-scoring grounder, Cabrera was given an RBI single following a challenge by Ausmus. The call that center fielder Desmond Jennings had made a sliding catch on Cabrera's two-out liner was overturned.
Loney's homer put the Rays up 3-0 in the first.
Belnome doubled for his first big league hit and scored to make it 4-0 on Zobrist's second-inning single. Belnome had what would have been his first homer in the fourth changed to a foul after a video review.
"We got burned on replay twice but they were the right calls," Rays manager Joe Maddon said. "Had replay not been part of the game, we would have won that game tonight."
Scherzer had allowed three runs or fewer in each of his previous 10 starts.
Tigers: Right-hander Justin Verlander (sore right shoulder) could throw off a mound in a couple of days and might start Saturday. Outfielder Andy Dirks (back surgery) injured a hamstring at Triple-A Toledo and could miss the rest of the season.
Rays: Outfielder Wil Myers (broken right wrist) is expected back this week. Catcher Ryan Hanigan (oblique) and outfielder David DeJesus (broken left hand) are nearing rehab assignments.
Tigers RHP Rick Porcello (13-7) and Rays RHP Jake Odorizzi (9-9) are Wednesday night's scheduled starters.
Tigers Top Rays In 11
Highlight Of The Night: Four walks and a wild pitch in the top of the 11th inning contributed to three runs and pushed the Tigers to an 8-6 win over the Rays.