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.

More Images
Arizona Diamondbacks starting pitcher Zack Greinke throws against the Milwaukee Brewers during the first inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

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.

Arizona Diamondbacks Eduardo Escobar cannot stop a double hit by Milwaukee Brewers' Christian Yelich during the fourth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

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.

Milwaukee Brewers starting pitcher Gio Gonzalez throws during the first inning of a baseball game against the Arizona Diamondbacks, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Greinke (2,548) passed No. 31 Tim Keefe (2,555) and No. 30 Jerry Koosman (2,556) on baseball's all-time strikeouts list.

Arizona Diamondbacks' Carson Kelly scores on a double hit by Zach Greinke as Milwaukee Brewers catcher Yasmani Grandal looks down during the fifth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Gonzalez had been out since May 29 with arm fatigue and made two rehab starts before returning to the rotation.

Milwaukee Brewers' Eric Thames crosses home plate after hitting a solo home run against the Arizona Diamondbacks during the sixth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Gonzalez allowed five runs on five hits in four innings.

He was replaced by Andrew Chafin (0-2), who allowed an infield single and a walk to set the table for Moustakas' 26th homer.

Arizona Diamondbacks starting pitcher Zack Greinke throws against the Milwaukee Brewers during the first inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Arizona Diamondbacks starting pitcher Zack Greinke throws against the Milwaukee Brewers during the first inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

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.

Arizona Diamondbacks Eduardo Escobar cannot stop a double hit by Milwaukee Brewers' Christian Yelich during the fourth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Arizona Diamondbacks Eduardo Escobar cannot stop a double hit by Milwaukee Brewers' Christian Yelich during the fourth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

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.

Milwaukee Brewers starting pitcher Gio Gonzalez throws during the first inning of a baseball game against the Arizona Diamondbacks, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Milwaukee Brewers starting pitcher Gio Gonzalez throws during the first inning of a baseball game against the Arizona Diamondbacks, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

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.

Arizona Diamondbacks' Carson Kelly scores on a double hit by Zach Greinke as Milwaukee Brewers catcher Yasmani Grandal looks down during the fifth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Arizona Diamondbacks' Carson Kelly scores on a double hit by Zach Greinke as Milwaukee Brewers catcher Yasmani Grandal looks down during the fifth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Gonzalez allowed five runs on five hits in four innings.

TRAINER'S ROOM

Diamondbacks: RHP Matt Andriese (left foot contusion) was placed on the 10-day injured list after taking a liner off the foot against the Brewers on Friday night. Arizona recalled RHP Stefan Crichton from Triple-A Reno to take his roster spot. ... OF David Peralta took batting practice and ran the bases before the game in his return from an inflamed right shoulder. He could go on a rehab assignment soon.

Milwaukee Brewers' Eric Thames crosses home plate after hitting a solo home run against the Arizona Diamondbacks during the sixth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

Milwaukee Brewers' Eric Thames crosses home plate after hitting a solo home run against the Arizona Diamondbacks during the sixth inning of a baseball game, Saturday, July 20, 2019, in Phoenix. (AP PhotoMatt York)

UP NEXT

Brewers: RHP Brandon Woodruff has four straight quality starts heading into Sunday's series finale. The first-time NL All-Star allowed a run on five hits in 6 2/3 innings against Atlanta on Tuesday.

Diamondbacks: LHP Alex Young has made a strong case to remain in the rotation, going 3-0 with a 0.96 ERA in four starts to open his rookie season.

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports