DETROIT -- Max Scherzer struck out a season-high 14 batters and collected his American League-leading 14th victory as the Detroit Tigers defeated the Pittsburgh Pirates 5-2 on Thursday afternoon at Comerica Park.

Scherzer (14-4) out-dueled Francisco Liriano while coming up one strikeout shy of his career high. Scherzer, who has struck out 10 or more batters six times this season and 24 times in his career, didn't give up a run on three hits in eight innings.

Left fielder J.D. Martinez drove in Detroit's first two runs with a solo home run and a bases-loaded walk. Third baseman Nick Castellanos added a two-run single for the Tigers (65-54), who have won two straight following a four-game losing streak

Pinch hitter Gaby Sanchez hit a two-run homer off reliever Phil Coke in the ninth for the Pirates (64-57). Liriano (3-9) allowed two runs and three hits in six innings while recording nine strikeouts.

Martinez ended a scoreless deadlock with his fifth-inning leadoff homer, the first hit allowed by Liriano.

Detroit made it 2-0 in the sixth on Martinez's two-out, bases-loaded walk, forcing in center fielder Rajai Davis, who had a leadoff double.

The Tigers added three two-out insurance runs off reliever Brandon Cumpton in the eighth. Cabrera scored from second base on second baseman Michael Martinez's throwing error after a J.D. Martinez infield single. Castellanos followed with his two-run single to center.

NOTES: Tigers RHP Joe Nathan apologized on Thursday morning for making two obscene gestures toward the fans after his outing on Wednesday. Nathan, the team's closer, was booed when he walked the first two batters he faced in the ninth inning but did not allow a run in the 8-4 victory. "Hearing it the whole inning just got the better of me and my frustration came out," said Nathan, who has a 5.11 ERA with six blown save opportunities. "It was bad on both parts. Frustration came out on both sides and I apologize to the fans and apologize to my kids and I will be better." ... Pittsburgh 2B Neil Walker, who has been battling lower back tightness throughout the month, went through a full workout on Thursday and was available to pinch hit. Walker's last at-bat was a pinch-hitting appearance on Saturday. ... Pittsburgh's 118 runs scored since the All-Star break entering the game was the second most in the majors behind Oakland's 120. ... Tigers RHP Buck Farmer, who got a no-decision while pitching five innings his major-league debut on Wednesday, was optioned to Triple A Toledo. RHP Melvin Mercedes was recalled from the Mud Hens.