Greinke (6-1) efficiently worked his way through the Pittsburgh lineup, allowing four hits while striking out five and walking none. He had retired 11 in a row when he expressed slight discomfort after throwing his 95th pitch -- a ball to relief pitcher Chris Stratton with two outs in the eighth.
He was taken out after a brief discussion on the mound, leaving with an 8-0 lead.
After the game, Arizona manager Torey Lovullo told reporters that Greinke will undergo an MRI exam on Friday.
"Hard to say right now," Lovullo said of Greinke's prognosis. "I'm always in the clouds, optimistic about things. I'm going to obviously hope for the absolute best. Zack's honesty in walking off the mound, the way he did it -- not pitching through anything -- was a really, really smart move. It didn't have anything to do with any at-bats or running the bases; it was right then and there that he felt it."
Greinke has allowed five earned runs in his past six starts, spanning 41 1/3 innings.
Arizona's Blake Swihart hit an inside-the-park homer in the eighth, with his drive to right-center caroming off the base of the wall past two outfielders. He scored standing up despite running through a stop sign from the third-base coach.
Pittsburgh starter Chris Archer (1-3) was erratic as he was coming off the injured list (right thumb inflammation) and pitching for the first time since April 26. He gave up four hits and seven runs (six earned) in 3 2/3 innings, striking out five and walking four.
Archer walked three of the first four batters, and each came around to score.
Ketel Marte drove in the first run with a bases-loaded single, and the Diamondbacks scored twice more after third baseman Colin Moran mishandled a sharp grounder that had a chance to be an inning-ending double play.
Archer settled down to retire 10 in a row and had two outs in the fourth before John Ryan Murphy doubled, Greinke walked on four pitches, Jarrod Dyson hit a two-run single and Eduardo Escobar hit a two-run homer for a 7-0 lead, chasing Archer after 80 pitches.
Adam Jones lined the first pitch from Stratton in the fifth inning just inside the left-field foul pole for his ninth home run and an 8-0 Arizona lead.
Pittsburgh first baseman Josh Bell went 2-for-4, hitting safely in his 15th consecutive game, the longest current streak in the majors.
Arizona outfielder David Peralta, batting .318, left in the sixth inning for what the team called right trapezoid tightness.
Escobar drove in three runs. Dyson went 2-for-4 with two RBIs, three runs scored and two stolen bases, giving him a National League-leading 11.
--Field Level Media