SAN FRANCISCO (AP) -- Tim Lincecum has been on such a roll over the past three weeks that even a matchup against longtime nemesis Paul Goldschmidt wasn't enough to rattle the two-time NL Cy Young winner.
About the only thing to slow Lincecum down was a blister on the middle finger of his pitching hand.
Lincecum extended his winning streak to four straight starts with another stellar outing, combining with two relievers on a five-hitter in San Francisco's 5-0 win over the Arizona Diamondbacks on Friday night.
''I just tried to make him as a batter, not too big,'' Lincecum said. ''I know he's hurt me in the past ... but if I stick to my game plan, things are going to turn out for the best. He's that guy that I just need to bear down in the zone.''
Goldschmidt entered the game with a .577 career batting average against Lincecum and had already hit a pair of home runs off the Giants right-hander this season.
Lincecum got the better of Goldschmidt this time, holding the Arizona first baseman hitless in three plate appearances. Goldschmidt did get a hit, singling off reliever Juan Gutierrez in the ninth.
''His stuff the last few games has been really good,'' Giants manager Bruce Bochy said. ''He just is in a good rhythm out there and he's throwing with a lot of confidence. He's been on a good roll.''
Lincecum (9-5) allowed three hits over seven innings and fanned Gerardo Parra to end a two-on, two-out jam in the seventh. The owner of a no-hitter this season, Lincecum struck out six and walked two.
It is the first time Lincecum has won four consecutive starts since April 5-23, 2010. During his current streak, he has given up just one run over 30 1-3 innings - a remarkable 0.30 ERA.
Lincecum helped himself at the plate and recovered after stumbling over the bag while covering first base on Aaron Hill's infield grounder for the final out in the third.
''My stuff isn't as great as it used to be, but I still try to think that way and get guys out down in the zone,'' Lincecum said. ''I'm not afraid to throw any of (my) pitches in any situation. That confidence has kind of carried me through these outings.''
Gutierrez pitched 1 1-3 innings and Jeremy Affeldt got the final two outs to complete the shutout.
Pablo Sandoval homered and drove in three runs to break out of a slump that extended back to late June. The Giants third baseman, hitting just .222 over his previous 16 games, also had an RBI-double and an infield single.
San Francisco had lost 15 of its last 19 games at AT&T Park before jumping on Arizona starter Mike Bolsinger (1-6) for two runs in the first and two more in the second.
Sandoval got the Giants going with his 11th home run of the season, a two-run drive to right. San Francisco had hit just 14 home runs since June 8, the fewest in the majors, until Sandoval's shot.
''That was nice to see, I'm not going to lie,'' Bochy said. ''To get some early run support, that makes life easier.''
Brandon Crawford's RBI single in the second made it 3-0. Lincecum followed with a safety squeeze to drive in Joe Panik, who walked and took third on Crawford's hit.
Hunter Pence and Brandon Belt opened the fifth with consecutive singles before Sandoval doubled down the left field line to extend the Giants' lead to 5-0.
Bolsinger gave up five runs and eight hits over five innings. The Arizona rookie struck out five and walked two but is winless since April 24.
''He was leaving the ball up early and they hammered it,'' Diamondbacks catcher Miguel Montero said. ''These guys like to swing early and you have to make quality pitches out of the gate. He wasn't able to do that.''
Before the game the Giants activated second baseman Marco Scutaro from the disabled list. The 38-year-old infielder, who played a pivotal role in San Francisco's march toward the 2012 World Series championship, has not played this season because of a lower back strain.
The Diamondbacks welcomed back one of their key players but didn't get the same spark. Outfielder Mark Trumbo, sidelined with a stress fracture in his left foot since April 21, went 1 for 4 and grounded out to third to end the game.
NOTES: Lincecum has pitched 27 consecutive scoreless innings at AT&T Park. ... Montero was picked for the NL All-Star team as a replacement for injured St. Louis catcher Yadier Molina. ... Goldschmidt has reached base safely in 31 straight games, matching his career high. ... To make room for Trumbo, the Diamondbacks optioned OF Roger Kieschnick to Triple-A Reno. ... LHP Wade Miley (4-6), Arizona's starting pitcher on Saturday, has a 3.63 ERA in seven career games against San Francisco. ... Giants RHP Ryan Vogelsong (5-6) has lost his previous three starts. ... San Francisco signed first-round draft pick Tyler Beede to a contract that includes a signing bonus of more than $2.6 million. Beede was the 14th overall pick in last month's draft. ... To make room for Scutaro, 2B Brandon Hicks was designated for assignment.