Updated

St. Petersburg, FL (SportsNetwork.com) - Torii Hunter scored the winning run on a wild pitch in the 11th inning and the Detroit Tigers took an 8-6 win over the Tampa Bay Rays in the opener of a three-game series.

J.D. Martinez hit a solo home run while Ian Kinsler added two hits, an RBI and two runs scored for the Tigers, who have won four of their last six games.

Max Scherzer tossed seven innings in the start and allowed four runs on four hits along with three walks while striking out nine. Jim Johnson (5-2) picked up the win after tossing a scoreless 10th inning.

"Max and the offense picked it up as the game went on," Tigers manager Brad Ausmus said.

The win keeps Detroit two games back of Kansas City for first place in the AL Central, as the Royals defeated the Rockies on Tuesday night.

James Loney went 3-for-4 with a three-run home run while Ben Zobrist had two hits, an RBI and two runs for the Rays, who have lost their past three games.

"Got a nice lead, we gave that back up, fought back into it, had opportunities to win it," Rays manager Joe Maddon said.

Chris Archer was touched for four runs -- one earned -- on five hits over 5 2/3 innings. Grant Balfour (1-5) allowed all three runs in the 11th to absorb the loss.

Kinsler led off the 11th with a floater to right that Kevin Kiermaier tried to make a diving play on, but the ball hit off his glove and rolled to the wall as Kinsler pulled up at third base. A walk to Hunter was followed by an intentional walk to Miguel Cabrera before Victor Martinez forced in a run with a walk.

Jeff Beliveau then took the mound and got Ezequiel Carrera to look at strike three, but then he uncorked a wild pitch that allowed Hunter to score. Don Kelly then walked to again load the bases and Bryan Holaday's sacrifice fly made it an 8-5 game.

Joe Nathan ran into trouble in the bottom of the 11th as Evan Longoria hit an RBI single with two outs to make it a one-run game. That left men at first and second with Sean Rodriguez as the potential go-ahead run, but Nathan struck him out to pick up his 26th save of the season.

The Rays grabbed the lead in the first inning when Zobrist was hit by a pitch, Longoria drew a walk and Loney followed that with a blast over the right field wall for a 3-0 advantage.

Tampa added to its advantage in the second on an RBI single from Zobrist for a 4-0 lead.

Tampa nearly got another run in the fourth when Vince Belnome led off with a shot over the right field wall that appeared to stay fair and was ruled a home run, which would have been the first of his career. The replay, though, showed that the ball went foul just in front of the pole.

The fifth inning saw the Tigers cut into their deficit as the team loaded the bases with one out and Kinsler brought in the first run on a walk. Hunter then hit into a 6-5 force out that plated another run and left men at first and second.

Cabrera then blasted a liner to center that Desmond Jennings appeared to grab for the final out. However, replay determined that the ball hit the ground before going into the glove and the overturned call led to another run scored and a 4-3 game. Victor Martinez then popped out to end the frame

Detroit then tied the game in the sixth as back-to-back two-out walks from Alex Avila and Andrew Romine were followed by an RBI single from Rajai Davis.

J.D. Martinez's solo blast in the eighth briefly gave the lead back to Detroit, but Belnome's sacrifice fly in the home portion once again tied the contest.

Game Notes

Tampa Bay had taken three of four in Detroit in early July ... Detroit was just 2-for-15 with runners in scoring position and stranded 12, while Tampa Bay went 4-for-10 with RISP and left 11.