The Rockies' offense also got a boost from shortstop Trevor Story, who homered to lead off a three-run fourth inning. Story was playing in his first game since July 30, when he suffered a torn ligament in his left thumb.
The D-backs had grabbed an early lead, thanks to a three-run first inning that was capped by Jake Lamb's two-run homer to right-center.
Arizona's Shelby Miller, who is trying to rebound from a disappointing 2016, retired the Rockies in order in the first and was one out away from pitching out of a jam in the second before Gerardo Parra singled to right to drive home two.
"I felt good," Miller said. "I threw a lot of first-pitch strikes, which is what you want. Stuff-wise, I felt pretty good. Curveball was good, cutter was good. Early on in camp, I feel pretty good about that."
Anderson, who gave up the homer to Lamb on a cutter he left over the plate and gave up five hits in 1 1/3 innings, said, "I didn't do a very good job of command and controlling that excitement, so I got a little ahead of myself with my body. Going back out for the second inning, I had a little better feel."
Rockies: It will be a split-squad Sunday. Lefty Chris Rusin will start against the White Sox at Glendale, Ariz., at 1:10 p.m. MT, and righty German Marquez will start against the D-backs at 1:05 p.m. Rusin and Marquez are among competitors for an open rotation spot, with Rusin a distinct bullpen possibility.
D-backs:Braden Shipley starts for the D-backs on Sunday against the Rockies. Shipley is trying to force his way into the conversation for a rotation spot.