PHOENIX -- Arizona Diamondbacks first baseman Paul Goldschmidt hit his first career home run against San Francisco right-hander Tim Lincecum two days into his major league career in 2011, and the hits just keep on coming.

Goldschmidt continued his uncanny success against Lincecum on Friday, getting two hits and scoring twice to key the Diamondbacks' 4-1 victory at Chase Field that sent the San Francisco Giants to their season-long sixth straight loss.

"I got some pitches today," Goldschmidt said. "Both the pitches were kind of up in the zone, middle of the plate. Fortunately I was able to get those. I don't know. Just try to get good at-bats. Sometimes there are guys you do well off of. Sometimes there are guys that have your number."

Goldschmidt walked and scored when Arizona took the lead with a two-run fourth inning, and he doubled and scored in the sixth. He singled in the first inning, and his double struck the left-field fence about three feet short of a homer.

Goldschmidt is 15-for-26 (.577) with seven home runs and 17 RBIs against Lincecum in his career.

"He is a pretty patient guy," said Lincecum (5-5). "I am not really executing pitches against him, which makes it really tough. That and a combination that he is a .311 hitter."

Not only did Goldschmidt hit his first career homer off Lincecum, he hit his first homer of the 2012 season against Lincecum and hit the first two of this season against him.

"Lincecum has thrown the kitchen sink at him," Arizona manager Kirk Gibson said. "I know Tim Lincecum. I respect him a lot. He's a competitive guy. You just enjoy the success while you can. It's a pretty good matchup. He did a decent job of containing Goldy tonight. Kept him in the park."

Second baseman Aaron Hill had two hits and two RBIs for the Diamondbacks (32-45), who have won two of their last three games.

First baseman Buster Posey had two hits and a walk for the Giants (43-30), who have lost nine of their last 10 and have seen their division lead go from 9 1/2 games to four games in 12 days.

Third baseman Pablo Sandoval tripled and walked, driving in the Giants' only run in the first inning. Sandoval has a .343 career batting average at Chase Field, with six homers and 31 RBIs in 48 games.

The Giants left two runners on base in the first, third and fifth innings against Arizona right-hander Josh Collmenter (5-4), who gave up one run in five innings to improve to 5-1 against the Giants in his career.

"We created many chances out there that just came up short," San Francisco manager Bruce Bochy said. "The mood has been good despite these 10 days. You are going to have those moments, unfortunately, in this game."

Arizona closer Addison Reed struck out the side in the ninth for his 17th save.

Two-time Cy Young winner Lincecum gave up four runs on seven hits in six innings.

The Diamondbacks took a 2-1 lead in the fifth inning when Goldschmidt walked with one out, stole second, and scored on Hill's single to center field. Third baseman Martin Prado doubled to the base of the center-field fence to drive in Hill.

Center fielder Ender Inciarte singled and scored on shortstop Chris Owings' two-out triple off the center-field fence in the fifth inning for a 3-1 Arizona lead. Owings was thrown out at home attempting an inside-the-park homer.

Hill's sacrifice fly drove in Goldschmidt for the final run.

NOTES: Arizona RHP J.J. Putz was designated for assignment Friday when OF Ender Inciarte was activated from the seven-day concussion disabled list. Putz, 37, has 189 saves in a 12-year major league career and is second in D-backs history with 83 saves. He had a career-high 45 saves in 2011, when Arizona won the NL West. ... San Francisco CF Angel Pagan (back) took batting practice and took fly balls Friday, and manager Bruce Bochy said there is "a good chance" that Pagan will play Saturday after missing the previous four games. Pagan had an epidural three days ago. ... The D-backs signed RHP Touki Toussaint, their first pick in the June draft, on Friday. Toussaint was the 16th player taken. ... The Giants have won five straight series at Chase Field, last losing when they were swept April 6-8, 2012, the first three games of the season.