Updated

Hunter Pence had three hits, including a solo homer, scored three times and knocked in two Sunday to lead the San Francisco Giants to an 8-2 win over the Arizona Diamondbacks.

Buster Posey also had three hits and drove in two and Hector Sanchez knocked in three for the Giants, who took two out of three in the series. They had nine hits and scored five runs off Arizona starter Patrick Corbin (13-5).

Yusmeiro Petit, who won his first start of the season Tuesday at Colorado, made it two in a row for the Giants. Petit (2-0) struck out 10 in seven-plus innings, giving up two runs on seven hits and a walk.

"That's another great start for him in two tough ballparks," said Giants manager Bruce Bochy. "He had great command, hit his spots and mixed it up. He's got some savvy out there. He knows what he's doing."

Corbin gave up eight earned runs in 5 1/3 innings at Philadelphia last Sunday and wasn't much better in his next start. He allowed nine hits and a walk in five innings, striking out six, and is 1-4 in his last seven starts.

"I just wasn't able to locate anything," said Corbin. "I left some pitches up."

Arizona, chasing the second NL wild card, are 3-3 on a nine-game homestand that ends with three against the Toronto Blue Jays beginning Monday.

The Giants took a 4-1 lead in the fourth inning with a three-run rally sparked by Posey's single and Pence's double. Both runners came home on Sanchez's double and Sanchez scored on Petit's fourth career hit.

Pence's 17th homer of the season made it 5-1 in the fifth and the Diamondbacks got a run back on Adam Eaton's single in the seventh, but the Giants tacked on three in the ninth.

Posey hit a two-run double and Pence scored him with a single to make it 8-2.

The Giants had 15 hits and moved to 3-3 on a nine-game road trip. They will visit San Diego to play the last three against the Padres starting Monday.

Arizona took a 1-0 lead in the first inning on Martin Prado's two-out RBI double. Pence walked to lead off the second for the Giants and scored from third base later on Sanchez's groundout to tie the game.

Game Notes

The Diamondbacks acquired right-handed pitcher Matt Langwell from the Cleveland Indians to complete the Aug. 30 trade for outfielder Jason Kubel. They recalled pitchers David Hernandez and Tony Sipp from Triple-A Reno ... The Giants lead the season series 10-5.