Greinke (7-5) struck out seven and walked none. It was his first scoreless outing this season. The veteran right-hander returned after two rain delays, 25 minutes in the bottom of the first and 56 minutes in the middle of the fourth.

The Diamondbacks have won three straight games and go for a four-game series sweep Sunday. The Pirates have dropped four in a row and five of six.

Pittsburgh starter Joe Musgrove (2-3) gave up five runs and seven hits in four innings, with two strikeouts and three walks. He did not return after the second rain delay.

Arizona got to work right way. Goldschmidt drew a one-out walk in the first inning. An out later, Peralta tripled to the corner in right. Goldschmidt scored, and Peralta came home on cutoff man Sean Rodriguez’s wild throw home for a 2-0 lead.

In the third, Goldschmidt again walked with one out. Jake Lamb singled and Peralta followed with an RBI double. Daniel Descalso was intentionally walked to load the bases, and Chris Owings followed with an RBI single for a 4-0 lead.

The Diamondbacks added another run in the fourth when Greinke doubled to the corner in left and Jon Jay drove him in with a double down the opposite line, making it 5-0.

Goldschmidt led off the seventh with a liner to left, his 17th homer, to increase the lead to 6-0.

With Greinke out of the game, the Pirates broke up the shutout in the seventh. Elias Diaz hit a one-out single, moved to second on Josh Bell’s grounder and scored on Jordy Mercer’s single to make it 6-1.

Lamb’s RBI single in the ninth pushed it to 7-1.

Bell’s base hit in the Pirates’ ninth gave him a team-leading 37 RBIs and made it 7-2.