The All-Star outfielder was 0 for 4 with two strikeouts in his debut with the defending World Series champions, who won two of three against the major league-leading Phillies in a rematch of the NLCS.
Lincecum (9-8) showed no negative effects from the stomach illness that forced him to push his start back two days. The two-time NL Cy Young Award winner allowed three hits, struck out six and worked around four walks.
The Phillies hadn't lost consecutive games since June 4. They went a club-record 45 straight games without dropping two straight.
Sandoval gave the NL West leaders a 1-0 lead when he led off the second inning with an opposite-field shot to left. It was Sandoval's 10th homer, becoming the first Giant to reach double digits this season. Beltran hit 15 for the Mets before he was traded to San Francisco for pitching prospect Zack Wheeler.
The addition of Beltran should bolster a sagging offense that's near the bottom in the major statistical categories. Beltran started in right field and batted third. He contributed defensively, making a sliding catch to rob Jimmy Rollins of a hit on a shallow fly in the fifth. Beltran's streak of reaching base safely was snapped at 32 games.
Phillies starter Kyle Kendrick (5-5) gave up four runs - three earned - and six hits in 6 1-3 innings.
In the seventh, the Giants had runners at first and third with one out when pinch-hitter Aaron Rowand hit a grounder to third. Michael Martinez bobbled it and then made a wild throw to first base. Schierholtz scored from third and Chris Stewart came all the way around from first, sliding in safely on a close play at the plate to make it 4-0.
Brian Wilson finished for his 33rd save in 37 chances.
Before the at-bat against Affeldt, Utley had stranded five runners, including three in scoring position, in his first three times up.
The Phillies had a runner on third with one out in the first after Rollins led off with a double and advanced on a bunt. But Utley popped out to shortstop and Ryan Howard struck out. Utley struck out with men on first and third to end the third. He struck out with two runners on to end the fifth.
A crowd of 45,646 on Fireworks Night was the 192nd straight sellout, including postseason play, at Citizens Bank Park. They gave Beltran an earful of boos when he batted in the first.
Notes: Roy Oswalt (back) is expected to make another rehab start before possibly rejoining Philadelphia's rotation. ... All-Star 3B Placido Polanco is moving closer toward returning to the Phillies. He's scheduled to play nine innings for Triple-A Lehigh Valley on Friday. ... Rollins snapped an 0-for-19 slump with his double. ... The Giants designated INF Bill Hall for assignment and optioned UTL Emmanuel Burriss to Triple-A Fresno. ... San Francisco is 8-1 in rubber games of series.
READ MORE ON CSNBAYAREA.com