Updated

Patrick Corbin spun eight effective innings and registered the first four RBI of his career, as the Arizona Diamondbacks downed the San Francisco Giants, 10-2, in the finale of a three-game set Sunday at Chase Field.

Corbin (6-7) allowed both runs on eight hits and a walk with five strikeouts. The rookie left-hander added a three-run triple and an RBI single in the victory as the D'backs avoided a three-game sweep.

Justin Upton homered for the second consecutive game and knocked in three overall, while Aaron Hill plated a pair for Arizona, which sits 4 1/2 games out of the final NL wild-card spot.

Ryan Vogelsong (12-9) was tagged for seven runs -- six earned -- on five hits and four walks in 3 1/3 frames to take the loss.

"His stuff is good. He's just going through a rough period," Giants manager Bruce Bochy said of Vogelsong.

Buster Posey had an RBI and a run scored, but the Giants saw their four-game win streak come to an end.

Posey's RBI single in the first gave the Giants a 1-0 lead, but the D'backs countered with a pair in the third when Adam Eaton worked a two-out walk, Hill singled and both cross home on Upton's double off the wall in center field.

Brandon Belt clubbed an RBI double in the top of the fourth to tie the game, but Arizona erupted for a five-run bottom half to take the lead for good.

Paul Goldschmidt reached on Joaquin Arias' fielding error to start the frame and Cody Ransom followed two batters later with a double.

Gerardo Parra was then intentionally walked to load the bases for Corbin, who pulled a triple down the first-base line, clearing the bases for a 5-2 lead.

After Eaton walked, Shane Loux replaced Vogelsong on the mound and Hill greeted Loux with a double down the third-base line, scoring Corbin and Eaton to cap the five-run frame.

Upton extended the Arizona lead in the sixth when he lifted a towering blast down the left-field line to make it an 8-2 margin.

"I wasn't squaring the ball up earlier in the season, but stringing together a couple of good days has been nice," Upton said.

Arizona added two more in the seventh, as Ryan Wheeler and Parra worked walks around a Ransom strikeout before Corbin looped a single into center field to score Wheeler.

With Eaton at the plate, Parra crossed home on a passed ball to account for the final margin.

Game Notes

Vogelsong fell to 2-4 over his last seven starts ... The Giants went 2-for-12 with runners in scoring position and left seven men on base ... Arizona finished 4-for-8 with runners in scoring position and stranded eight.