Two of the three hits Pelfrey (7-6) allowed over seven sharp innings were infield singles. He struck out five and walked none in a dominant performance, pushing the Mets (46-44) two games above .500 for the first time since May 20.
Fernando Tatis added a 450-foot solo homer in the eighth off Kevin Correia. Scott Schoeneweis and Joe Smith each worked a perfect inning to complete New York's third shutout this season.
Blanked for the sixth time, the Giants were outhit 14-3.
Lincecum, selected to his first All-Star team Sunday, allowed a season-high nine hits in six innings. He struck out four, increasing his NL-high total to 126.
The 24-year-old right-hander was 6-0 in 12 starts since his other loss, 3-2 against Colorado on April 29.
Pelfrey is also 24. He hasn't emerged as quickly as Lincecum, but the 6-foot-7 right-hander appears to be coming into his own this summer.
Pelfrey hasn't lost in eight outings since dropping his sixth start in a row May 26 against Florida. He escaped a bases-loaded jam in the first and threw 73 of his 113 pitches for strikes.
Lincecum gave up a one-out single to Endy Chavez in a 32-pitch first inning, then walked David Wright. Beltran lofted a 2-2 delivery to right that carried over the fence for his 250th career home run.
Delgado added a 435-foot drive to right-center with two outs in the sixth for his 16th of the season and fifth in the past 13 games.
Argenis Reyes opened the seventh with a pinch-hit single off Jack Taschner for his first major league hit. Jose Reyes reached on a bunt single, and the Mets made it 6-0 on two-out RBI singles by Beltran and Damion Easley.