Updated

Paul Goldschmidt blasted a three-run homer and knocked in a career-high five runs on Tuesday as the Arizona Diamondbacks defeated the San Francisco Giants, 7-2, in the opener of a three- game series at AT&T Park.

Aaron Hill went 3-for-5 with three runs scored and Justin Upton crossed the plate on a wild pitch for the Diamondbacks, who are 5 1/2 games behind the St. Louis Cardinals for the second and final National League wild card spot.

Josh Collmenter (5-3) gave up just one run on two hits and two walks with four strikeouts over five innings to win for the first time since Sept. 4.

"He did a great job for us today," Diamondbacks manager Kirk Gibson said of Collmenter.

Buster Posey knocked in a run with a double and Ryan Theriot added a pinch-hit RBI double for the Giants, who have lost two straight, but have already locked up the NL West crown.

Tim Lincecum (10-15) was knocked around for seven runs on five hits and four walks over four-plus innings, snapping his string of three straight positive decisions.

"He was just off tonight, not much to say about it," said Giants manager Bruce Bochy of Lincecum.

Arizona got on the board in its first at-bat after loading the bases with no outs against Lincecum. The two-time Cy Young winner fanned Miguel Montero, but allowed a sacrifice fly to Goldschmidt for the first run, and uncorked a wild pitch with Jason Kubel at the plate which allowed Hill to score for a 2-0 lead.

Hill singled to begin the Arizona third and moved to second on a passed ball before Montero walked. Goldschmidt followed and blasted one deep and off the left-field foul pole, extending the D'backs lead to 5-0.

San Francisco finally got to Collmenter for a run in the fourth. Marco Scutaro led of the frame with a double down the line in left field, moved to third on a groundout by Pablo Sandoval and scored via a Posey double to left.

The bases were once again full with no outs in the Arizona fifth. Goldschmidt lofted a deep sacrifice fly to center field off Giants reliever Dan Runzler and Upton scored from third on a wild pitch to widen the D'backs lead to 7-1.

Xavier Nady ripped a pinch-hit, one-out single down the left-field line in the San Francisco eighth and came around to score on Theriot's double to make it a 7-2 game.

Game Notes

Goldschmidt is 8-for-14 with five home runs for his career against Lincecum ... The Giants fell to 6-2 on their current 10-game homestand ... San Francisco is 43-25 since the All-Star break ... Entering play on Tuesday, the Giants had won eight of their last 10 home games ... Scutaro extended his career-best hitting streak to 13 games ... Lincecum's first-inning wild pitch was his MLB-leading 17th of the season ... San Francisco finished 1-for-5 with runners in scoring position and left four on base.