Tommy Pham also had two hits, Kevin Ginkel (6-0) pitched an inning for the win and Paul Sewald got the final three outs for his 24th save.
Brenton Doyle homered and Nolan Jones and Elehuris Montero had three hits each for Colorado.
Arizona trailed 5-3 but rallied in the ninth off closer Justin Lawrence (3-6). Alek Thomas singled, Perdomo doubled and Ketel Marte singled to tie it at 5. Pham doubled to left to bring home Marte with the go-ahead run.
Gurriel singled to drive in another run, stole second and scored on Jace Peterson's single.
The D-backs went ahead in the third inning on Walker's two-run homer, his 26th homer of the season and second in as many nights.
Rockies starter Ty Blach settled down after that and left after allowing the two runs on six hits over five innings.
Colorado got one back in its half of the inning. Michael Toglia had a leadoff walk and Montero singled on a dribbler up the third-base line.
Groundouts by Doyle and Charlie Blackmon drove in Toglia to make it 2-1.
The Rockies tied it in the sixth inning when Blackmon led off with a triple to right and scored on Ryan McMahon's chopper to shortstop.
The D-backs went back in front in the seventh. Perdomo reached on a single and went to second on Brent Suter's errant throw to first. After a walk, Montero made a diving catch of a bunt attempt and Pham's groundout moved up the runners.
Elias Diaz's wild pickoff throw to third allowed Perdomo to score, but Marte was thrown out at home trying to score from second.
Colorado quickly erased the deficit when Jones and Toglia hit consecutive one-out doubles in bottom of the seventh and Doyle hit a two-run homer to make it 5-3. It was his eighth homer of the season.
—Field Level Media