DETROIT (AP) - David Peralta homered to left center in the ninth inning off Detroit closer Justin Wilson, lifting the Arizona Diamondbacks to a 7-6 win over the Tigers on Tuesday night.

Arizona reliever Archie Bradley (2-1) pitched a scoreless eighth to pick up the win. Zack Greinke, who was staked to a 6-0 lead in the third, went 5 2/3 innings and allowed five runs, all unearned, and five hits. Fernando Rodney pitched a scoreless ninth for his 17th save.

Wilson (2-2) took the loss after allowing the homer to Peralta on the first pitch in the ninth. Starter Buck Farmer went 2 1/3 innings and allowed six runs on nine hits. He was 2-0 and had gone 13 straight scoreless innings before Tuesday.

The Diamondbacks jumped on Farmer early, scoring twice in the first inning on Chris Owings' RBI single and Brandon Drury's RBI single.

Arizona added four runs in the third on two-run homers by Paul Goldschmidt and Drury, giving the Diamondbacks a 6-0 advantage.