Mulvey (0-3) had trouble in the second inning, allowing three runs, but otherwise pitched effectively for the D-backs.
"I felt like I battled back and settled down," Mulvey said. "I didn't help myself out there at all."
He went six innings, allowing four runs on six hits. He struck out four and walked one in his fourth career start.
"He battled himself early and pitched a little tentatively," D-backs manager A.J. Hinch said. "He showed us something by getting back into it. It's a mini-step forward."
With four career starts under his belt, Mulvey enters the offseason knowing he'll have a chance to break into the starting rotation when the time for pitchers and catchers to report arrives next February.
"It was nice to get the opportunity here in September," Mulvey said. "Hopefully I can pitch well in Spring Training."
The highlight of the night was Mulvey's first Major League hit, a sharp single up the middle. The lowlight was a baserunning error by Roberts that led to Mulvey getting thrown out at the plate.
As for his offensive prowess, Mulvey was a hard-hitting shortstop in high school, who batted third and hit close to .400. Once he got to Villanova, his bat was retired.
He recorded a lifetime batting average of .217 in the Minors, getting most of his at-bats in 2007 with Double-A Binghamton and a 2-for-3 effort at Triple-A New Orleans.
Mulvey reached second when Drew singled and went to third when Roberts hit into a forceout. Roberts then took off for second before Giants pitcher Brad Penny delivered the ball, making for an easy rundown.
"He was a little overzealous trying to make things happen," Hinch said. "It was a ridiculous mistake. It was a mental error that killed an inning in the middle of the order. With the way Miguel Montero has been hitting the past 24 hours, I would have liked to see him up with two runners on."
Mulvey allowed four hits in the second, two to start the inning to John Bowker and Travis Ishikawa. He hit Aaron Rowand to load the bases, gave up a two-run single to Eli Whiteside and then retired 14 of the final 15 batters he faced, with a sacrifice fly producing a run for the Giants.
Whiteside added a home run in the fourth.
The D-backs scored in the fourth. Geraldo Parra was on first base with two outs and Byrnes dribbled a grounder to the left of the mound.
Penny picked up the ball and found Byrnes' No. 22 an inviting target. The ball hit off Byrnes and traveled down the right-field line, allowing Parra to score and Byrnes to reach third.
"It wasn't like all of his pitches were pretty sharp, but we were chasing them out of the zone a lot," D-backs outfielder Justin Upton said of Penny. "His fastballs were up and his slider and splitter were down. We chased him all over the place and he was able to keep us off balance."