Updated

Flushing, NY (SportsNetwork.com) - Ryan Vogelsong pitched his second career complete game, Hunter Pence knocked in three runs and the San Francisco Giants beat the New York Mets 5-1 on Friday in the opener of a four-game series.

Vogelsong (6-8) went the distance for the first time since 2011, limiting the Mets to one run on two hits and a walk with five strikeouts to snap a five- game losing streak. It was his first nine-inning complete game, however, as the right-hander blanked the Chicago Cubs in a rain-shortened, six-inning affair on May 14, 2011.

"What a great game," Giants manager Bruce Bochy said. "Good for (Vogelsong). He's had some tough luck. Really, he did a great job of pounding the strike zone."

Brandon Crawford went 3-for-4 with an RBI and Matt Duffy added an RBI in his major-league debut for the Giants, who have won two straight after a six-game skid.

Jon Niese (5-7) was charged with five runs -- three earned -- on nine hits with four strikeouts over eight-plus innings in the setback.

"He has to make big pitches and he didn't make them," New York manager Terry Collins said of Niese. "I thought tonight (San Francisco) did damage when he made a mistake. I thought the quality of pitching was very good tonight."

San Francisco opened the scoring in the second with help from a costly error by Niese. Juan Perez doubled to lead off, then Gregor Blanco tapped a grounder back to Niese, who alertly checked Perez at second. However, Niese skipped a throw to Ruben Tejada which allowed Perez to advance to third. Crawford followed with a single to center past the drawn in infield that plated Perez.

A sacrifice bunt from Vogelsong put a pair of runners in scoring position before Pence's groundout knocked Blanco in for a 2-0 lead.

Vogelsong didn't allow a baserunner until Curtis Granderson began the fourth with a walk. Daniel Murphy then grounded into a 6-4-3 double play and David Wright flied out to right to end the inning.

Juan Lagares recorded New York's first hit to lead off the sixth with a single to center. Following a groundout by Tejada, Niese lined into an inning-ending double play.

The Giants broke the game open with a three-run seventh. Crawford tripled to right with one out, Vogelsong was hit by a pitch and Pence chased them home with a triple to right-center. Duffy's first major-league hit was a single to left that scored Pence.

Lucas Duda ended Vogelsong's shutout bid with his 20th homer of the season in the eighth.

Vogelsong, who hadn't won since June 21 at Arizona, wrapped up the gem with a 1-2-3 ninth inning as the game ended after just 2 hours and 6 minutes.

Game Notes

Prior to the game, the Giants designated second baseman Dan Uggla for assignment. Uggla went hitless in four games with the Giants. He struck out six times in 11 at-bats and committed three errors. San Francisco also designated outfielder Tyler Colvin for assignment and purchased the contracts of Duffy and Jarrett Parker from Double-A Richmond ... Niese threw 87 pitches in the loss, 68 for strikes ... Duda has never hit 20 homers prior to this season. His previous career high was 15 in both 2012 and 2013.