Updated

Aaron Hill's RBI single capped a four-run fifth inning as the Arizona Diamondbacks took a 4-2 win over the San Francisco Giants to open a four-game series.

Paul Goldschmidt hit a two-run double while Martin Prado added a run-scoring double for the Diamondbacks, who have won their past two games. Trevor Cahill (6-10) gave up two runs on six hits over five innings to win his third straight decision.

Pablo Sandoval and Hector Sanchez each drove in a run for the Giants, who have lost three of their last four. Ryan Vogelsong (3-5) was charged with all four runs on eight hits in 4 2/3 innings to take the loss.

The Giants jumped on top with two quick runs in the fourth as Hunter Pence worked a leadoff walk and scored on Sandoval's triple. Sanchez followed with a sacrifice fly for a 2-0 lead.

"It seems like I have one bad inning where I sort of lose it," Cahill said. "I got out of it with help from the right fielder. Then in the fifth, there were two outs and all of a sudden we're up. It's all about not giving up."

Arizona, though, answered in the fifth inning. With two outs, Adam Eaton doubled and Willie Bloomquist followed with a walk. Both runners moved up a base on a wild pitch, then scored on Goldschmidt's double. Prado then doubled home Goldschmidt and scored himself on Hill's single for a 4-2 lead.

"He just lost it and had trouble making a pitch," said Giants manager Bruce Bochy about Vogelsong. "He got the ball up and made some mistakes. He was doing great heading into that inning."

In the seventh the Giants had men on first and second with one out, but Brandon Belt popped into a double play as Marco Scutaro was caught off first.

Brad Ziegler retired the Giants in order in the ninth for his eighth save of the season.

Game Notes

Arizona has won just six of the 16 games against San Francisco this season ... Cahill moved to 5-3 in 11 games against the Giants ... Vogelsong dropped to 2-4 in 16 games against the D'backs ... Arizona batted 3-for-8 with runners in scoring position, but did strand nine men ... The Giants were 1-for-5 with RISP and left seven on base.