Yastrzemski hit a 3-2 pitch from Mets reliever Robert Gsellman over the left-field wall Sunday afternoon. The home run, Yastrzemski's ninth of the year, clinched a 2-1 victory at Oracle Park.
The win pushed the Giants, who were 37-47 on July 1, to 50-50 this season. San Francisco took three of four games from the reeling Mets.
"We're a bunch of grinders right now," Yastrzemski said. "It doesn't matter whether we're playing a doubleheader or extra innings."
Yastrzemski, the grandson of Boston Red Sox legend Carl Yastrzemski, is hitting .259 with nine home runs and 27 RBIs in 162 at-bats this year. The 28-year-old rookie has become an important piece for the Giants since debuting May 25.
"It was either a home run or it was an out," Yastrzemski said of his home run.
The Giants are 2 1/2 games behind the Milwaukee Brewers for the National League's second Wild Card spot.