Arizona has lost five in a row and 11 of 12, scoring just 24 runs in that span.

Greinke (3-3) struck out nine, walked none and gave up five hits in six innings, but the home runs did him in.

Shaw hit a two-run homer in the first, Santana sliced an opposite-field solo shot in the fourth and Cain homered leading off the sixth. Greinke hadn't allowed more than two home runs in a game this season.

Greinke, who got an extra day of rest before this game, slipped to 1-4 at Miller Park after a 15-0 stretch while pitching for the Brewers from May 9, 2011 to June 6, 2012.

Chase Anderson (4-3) threw six strong innings in his return to the rotation. He'd been ill and on the 10-day disabled list, came back and allowed three hits in his first start since May 6.

Anderson got off to a rough start. David Peralta led off with a single, and a walk and a hit batter loaded the bases. Another walk forced in a run before Anderson worked out of the jam.

Anderson retired 14 of the next 15 batters before Jake Lamb homered in the sixth.

Matt Albers pitched a perfect seventh, Jeremy Jeffress handled the eighth and Corey Knebel picked up his second save.

Lamb has played three games since coming off the 10-day disabled list. He had been on it since April 2 with a sprained shoulder. He hit a solo home run in the sixth, his first of the season. He hit a career-high 30 in 2017.

TRAINER'S ROOM

Diamondbacks: OF Steven Souza came out of Friday's game against the Mets with right pectoral soreness, the identical problem that put him on the 10-day disabled list earlier this season. "He re-aggravated that same original injury," manager Torey Lovullo said. "We are still calling it day-to-day."

Brewers: RHP Zach Davies (right rotator cuff inflammation) made a strong rehab start for Class A Wisconsin on Saturday. He struck out nine and allowed two hits over 4 2/3 innings.

UP NEXT

Diamondbacks: RHP Matt Koch (2-2, 4.06 ERA) looks for a big improvement in his seventh start this season. The previous one was his shortest of the year, an 8-2 loss to the Brewers. He allowed nine hits, including four home runs, in four 1/3 innings.

Brewers: RHP Jhoulys Chacin (3-1, 3.63 ERA) makes his 11th start overall and second straight start against the Diamondbacks in a week. He allowed one run on two hits over seven innings, but took a no decision in the 2-1 loss last Tuesday.