PHOENIX -- Conor Gillaspie fell a home run shy of the cycle, Johnny Cueto settled down after a rocky start to earn his 12th victory and the San Francisco Giants beat the Arizona Diamondbacks 6-4 on Friday night.
Trevor Brown doubled in two runs and Grant Green singled in two more for the Giants, who are 5-0 at Chase Field this season. San Francisco's Jarrett Parker added a solo homer off reliever Randall Delgado in the eighth.
Cueto (12-1) gave up four runs in the first three innings and blanked Arizona for the next four. The right-hander allowed seven hits in seven innings and struck out nine with no walks while improving to 8-0 on the road. Cueto joined Jake Arrieta of the Chicago Cubs as the only 12-game winners in the National League.
The Diamondbacks had runners at first and third with no outs against closer Santiago Casilla in the ninth. But Yasmany Tomas hit into a double play, Phil Gosselin walked, pinch-hitter Peter O'Brien struck out and Casilla escaped with his 18th save in 22 tries.
Shelby Miller (2-8) allowed six runs and eight hits in six innings and took the loss. He is 0-6 at home, where the Diamondbacks are 13-29.
San Francisco took the lead with two runs in the sixth. Parker and Gillaspie singled and, with two outs, Trevor Brown doubled down the right field line to bring both home and put the Giants up 5-4.
The Diamondbacks jumped on Cueto for three runs in the first inning. Doubles by Jean Segura and Paul Goldschmidt scored one, then Castillo hit Cueto's 3-2 pitch into the seats in left center to bring home two more.
Gillaspie, making just his 12th start of the season, tripled to right field in the second inning and was thrown out at home by shortstop Nick Ahmed on Grant Green's grounder. Gillaspie doubled and scored in the fourth and singled and scored in the sixth.
Giants: CF Denard Span was a last-minute scratch due to right neck stiffness. ... RHP Sergio Romo (right flexor strain) made his seventh rehab appearance Thursday night for Triple-A Sacramento, allowing one run and three hits in one inning.
Diamondbacks: RHP Zack Greinke will miss his next scheduled start on Monday (sore left oblique) but no decision has been made on whether to place him on the disabled list. RHP Archie Bradley will start in Greinke's place.
Giants: RHP Jeff Samardzija (8-5, 3.91 ERA), looks to rebound from his Tuesday night start, when he allowed six runs in six innings.
Diamondbacks: LHP Patrick Corbin (4-6, 4.99) takes the mound for Arizona in the second game of the three-game series.