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.
14,331 (42.1% full) - % is based on regular season capacity
Home Plate - Greg Gibson, First Base - Phil Cuzzi, Second Base - Will Little, Third Base - Gerry Davis
Before the All-Star Break, Victor Martinez hit .286 in at-bats to end in a breaking pitch; since the All-Star Break, he has hit just .130 in such at-bats. Since the break, Chris Archer has allowed a .079 average in at-bats to end in a breaking pitch, third best among qualifiers.
Max Scherzer allowed four earned runs in the first two innings Tuesday against the Rays, his most in a start since allowing a season-high 10 earned runs on June 17.
Scherzer only allowed four earned runs in his previous four starts combined entering Tuesday.