PHOENIX (AP) -- Mike Moustakas hit a three-run homer in the eighth inning and the Milwaukee Brewers scored six runs after Zack Greinke left to beat the Diamondbacks 8-3 Saturday night.
Greinke allowed two runs and struck out nine in seven innings to move into 29th on baseball's all-time strikeouts list, leaving with a 3-2 lead.
He was replaced by Andrew Chafin (0-2), who allowed an infield single and a walk to set the table for Moustakas' 26th homer.
Keston Hiura blooped a two-run single in the ninth and Christian Yelich had a run-scoring double in the inning for his third hit.
Adrian Houser (3-4) allowed a hit in 1 1/3 innings and Eric Thames hit a solo homer for the Brewers, who have won four of five.
Greinke was good early against the Brewers before running into trouble in the fourth inning. Ryan Braun hit a run-scoring single and Milwaukee loaded the bases with one out after Thames was intentionally walked, but Greinke ended the threat with two strikeouts.
Greinke (2,548) passed No. 31 Tim Keefe (2,555) and No. 30 Jerry Koosman (2,556) on baseball's all-time strikeouts list.
Greinke also had a run-scoring double to chase Gio Gonzalez in the fifth inning.
The Brewers reinstated Gonzalez from the 10-day injured list to start against the Diamondbacks, optioning right-hander Burch Smith to Triple-A San Antonio to make room on the roster.
Gonzalez had been out since May 29 with arm fatigue and made two rehab starts before returning to the rotation.
The Diamondbacks wore him out by the fifth inning.
Christian Walker hit a run-scoring single off Gonzalez in the first inning and the Diamondbacks chased him with three straight doubles to open the fifth. Carson Kelly and Greinke put Arizona up 3-1 with their run-scoring doubles.
Gonzalez allowed five runs on five hits in four innings.