PHOENIX -- Angel Pagan doubled and scored seven pitches into the game and Tim Lincecum threw six shutout innings to help San Francisco beat Arizona 1-0 at Chase Field on Friday.
Pagan, leading off for the Giants, doubled to deep right field on an 0-2 pitch from Randall Delgado (4-5) and moved around on a sacrifice bunt and Brandon Belt's sacrifice fly.
Lincecum (8-13) gave up six hits, walked two and struck out two in six scoreless innings, reversing a recent trend. He had lost his last six decisions against the D-backs and had given up 30 earned runs in his last 38 1-3 innings against them. He had not beaten them since Sept. 29, 2010.
Giants third baseman Pablo Sandoval preserved the 1-0 lead in the bottom of the sixth inning when he made a diving stop of A.J. Pollock's sharp two-out grounder down the line with the bases loaded and threw Pollock out at first.
Miguel Montero singled with one out in the ninth inning off Sergio Romo, who retired the final two batters for his 33rd save.
Right-hander Delgado gave up one run on three hits in seven innings, walking two and striking out three. He retired 10 of the final 11 he faced.
Paul Goldschmidt, who entered the game 9-for-17 with five homers off Lincecum, had one of the D-backs' seven hits, a single to center field with one out in the sixth inning.
Martin Prado singled to left field and Aaron Hill walked to load the bases, but Lincecum struck out Miguel Montero on a changeup before Sandoval robbed Pollock.
Goldschmidt has hit safely in 11 of his last 12 games for the Diamondbacks (68-65), who have lost six of their last nine.
San Francisco (60-74) has won four of its last six.
NOTES: Pagan was activated from the disabled list before the game after missing 69 games following hamstring surgery in late May. Pagan hit .262 with three homers and 24 RBIs before the injury. ... RHP Yusmeiro Petit will start the final game of the Arizona series on Sunday, Giants manager Bruce Bochy announced. LHP Barry Zito will be pushed back to Monday against San Diego, Bochy said. Petit, who won his first game Tuesday, will be pitching on regular rest. Zito will pitch on six days' rest. ... The D-backs traded OF Jason Kubel to Cleveland on Friday for a player to be named or cash consideration. Kubel was designated for assignment Wednesday after hitting .220 with five home runs and 32 RBIs in 89 games this season. Kubel led the D-backs with 30 homers and 90 RBIs last season, his first in the National League.