OAKLAND -- Pinch-runner Rajai Davis scored on Austin Jackson's fielder's choice groundout in the eighth inning and the Detroit Tigers beat the A's 6-5 Tuesday night to end a three-game losing streak.
J.D. Martinez drew a one-out walk off Oakland reliever Fernando Abad (0-2). Davis was brought in to run and the speedy outfielder took second on a passed ball. He then stole third when A's catcher Derek Norris was throwing the ball back to Abad.
After Luke Gregerson replaced Abad, Jackson hit a sharp grounder to Oakland shortstop Jed Lowrie, but the A's were unable to turn the double play and Davis raced home with the go-ahead run.
Miguel Cabrera and Torii Hunter homered for the AL Central-leading Tigers.
John Jaso homered for the A's.
Al Albuquerque (2-1) pitched one inning for the win and Joe Nathan worked the ninth for his 12th save in 15 tries.
The game began as a marquee matchup between starters Max Scherzer and Sonny Gray, but both were gone after the sixth.
Scherzer, the reigning AL Cy Young winner who beat the A's in Game 1 of the ALDS last season, gave up five runs and eight hits in six innings. He struck out four, walked two and balked home a run.
Gray, who led the AL in ERA entering the night, wasn't much better. He pitched with runners on base in nearly every inning, allowed four runs for the first time this season and struck out five before leaving with a one-run lead after the sixth.
The A's bullpen couldn't make it stand.
Reliever Dan Otero gave up Hunter's tying home run with two outs in the seventh before the Tigers scored off Abad in the eighth.
It was a much-needed boost for the slumping Tigers, who had dropped seven of eight before coming from behind to beat the A's.
Detroit, which was shut out in the series opener, got to Gray when Hunter doubled with one out in the first and scored on Cabrera's single up the middle. After Gray walked Victor Martinez on four pitches, J.D. Martinez lined an RBI double to right-center to make it 2-0.
Oakland tied it in the second on RBI doubles from Lowrie and Alberto Callaspo before Cabrera hit his tiebreaking home run in the third and Alex Avila doubled in Jackson in the fourth to make it 4-2.
Coming off his worst start of the season, Scherzer couldn't make it hold up. He balked home a run in the fourth after giving up back-to-back singles to Josh Reddick and Callaspo.
John Jaso followed with his fifth home run of the season, a two-run shot that gave Oakland a 5-4 lead.
NOTES: Texas 2B Ian Kinsler went 0 for 5 in his return to Detroit's lineup after getting his first day off Monday. That ended Kinsler's 11-game hitting streak. ... Donaldson has reached base in 42 consecutive games, the longest streak in franchise history since at least 1914, according to the team. ... The game featured three potential All-Stars. Detroit 1B Cabrera and 2B Kinsler, along with Oakland 3B Donaldson, are all leading at their respective positions in the first voting figures released by MLB. ... A's LHP Scott Kazmir (5-2) pitches Wednesday and has a 3.99 ERA in 13 career starts against Detroit. He'll oppose Tigers RHP Anibal Sanchez (2-2).