Jeff Keppinger had four hits as the Giants spoiled Oswalt's return from the disabled list. San Francisco avoided a four-game sweep in a matchup of NL division leaders.
Lincecum (10-9) went down in the eighth inning when Utley accidentally lost his grip and the bat skittered toward the mound. Utley went out to check on Lincecum, who handed back the bat, walked it off and stayed in the game. Utley then hit a one-out single.
Utley's act of sportsmanship was a far cry from the bench-clearing brawl between the clubs Friday night.
Lincecum left later in the eighth after Hunter Pence reached with two outs on first baseman Aubrey Huff's error. Javier Lopez relieved and retired Raul Ibanez on a fly ball.
Brian Wilson finished for his 34th save in 38 chances, closing out the Giants' second win in 10 games.
The NL East-leading Phillies, with the majors' best record at 74-40, hadn't lost since dropping two of three to the Giants in Philly from July 26-28.
Lincecum allowed seven hits and one run, struck out five and walked one in 7 2-3 innings. The two-time NL Cy Young Award winner and four-time All-Star beat the Phillies for the second time in three starts.
It was a timely performance for the reigning World Series champions, who have been struggling to score enough runs for their talented pitching staff. San Francisco held its half-game lead on Arizona in the NL West after the Diamondbacks beat the Dodgers.
Oswalt (4-7), facing Lincecum in their seventh career regular-season meeting, gave up a season-high 12 hits in his first start since June 23. The right-hander missed 37 games with lower back inflammation. He is 1-7 since beginning the year 3-0.
Phillies slugger Ryan Howard went 1 for 12 with eight strikeouts in the series and was 3 for 24 in seven games against the Giants this year. He struck out 12 times in 22 at-bats last October when San Francisco beat Philadelphia in the six-game NL championship series.
Orlando Cabrera hit a go-ahead sacrifice fly in the fifth and Keppinger added one of his own in the sixth.
The Giants produced 13 hits and avoided their first four-game sweep by the Phillies since losing in Philly from May 13-16, 1982 - and at home since Aug. 6-8, 1943, while playing in New York.
Chris Stewart added a pair of singles and an RBI and Pablo Sandoval had two hits for San Francisco, which loaded the bases against Oswalt in the fourth. Stewart delivered a single up the middle to tie the game at 1. The Giants finally made the most of some chances after going hitless in their first 18 at-bats of the series with runners in scoring position.
Huff's fourth-inning bloop single two batters ahead of Stewart ended an 0-for-22 stretch overall with runners in scoring position.
New Giants star Carlos Beltran was booed when he hit into an inning-ending double play in the first. But Phillies center fielder Shane Victorino, in the middle of the skirmish Friday, got it worse from the sellout crowd of 42,366 - and fans jumped to their feet and roared when he struck out looking in the third.
Phillies catcher Carlos Ruiz took a third-inning foul tip by Lincecum in the facemask but stayed in the game after being examined by trainers. He had two hits.
NOTES: Phillies 3B Placido Polanco flew home to Philadelphia to undergo an MRI exam Monday on his sore left hip. He came out of Saturday's game with the injury, which he said had been bothering him for some time and wasn't a result of being tackled by Giants catcher Eli Whiteside during the fracas Friday. ... Oswalt had his third hit of the year with a leadoff single in the third. ... San Francisco INF Miguel Tejada will likely go on a short rehab assignment soon before returning from the DL with a lower abdominal strain. ... Giants LHP Barry Zito's rehab outing with Class-A San Jose was pushed back from Sunday to Monday. He is likely to pitch four or five innings as he nurses a sprained right foot that also sidelined him earlier this year. ... Giants RHP and All-Star Ryan Vogelsong (9-1) tries to extend his career-best winning streak to seven straight decisions in Monday night's series opener against the Pirates. He is 6-0 with a 2.50 ERA over his last 12 outings. Vogelsong won at Pittsburgh in his first start of the year April 28, allowing two runs on four hits in 5 2-3 innings. He matched his career high with eight Ks. ... The Phillies continue their 10-game road trip against the NL West with the opener at Dodger Stadium. Roy Halladay (14-4) looks to win his fourth straight start. Philadelphia is headed into Game 18 of 20 in a row without a day off.