Yastrzemski scored the go-ahead run on Ryne Stanek's wild pitch in the eighth inning, Johnny Cueto pitched five scoreless innings in his second game back from Tommy John surgery and the Giants beat the Miami Marlins 2-1 Sunday.
Giants rookie Mauricio Dubon homered, and San Francisco took two of three from the struggling Marlins.
The grandson of Hall of Famer and Red Sox great Carl Yastrzemski, who was languishing in Baltimore's minor league system at the start of spring training, Yastrzemski has emerged as a building block player for the Giants, who open a three-game series in Fenway Park on Tuesday.
"It's special in the sense of the history of the game with my grandfather there. It's going to be pretty emotional and I'm going to try to contain those things, try to make it feel like it's any other game," Yastrzemski said.
"I've gotten to play against the Red Sox in spring training and they gave me a nice, warm welcome, so I'm not expecting anything, but I assume it'll be something like that."
Yastrzemski scored the go-ahead run on Stanek's second wild pitch. Yastrzemski and Brandon Belt reached on consecutive one-out singles against Jarlin Garcia (3-2). Both runners advanced on Stanek's first wild pitch before he walked Evan Longoria to load the bases.
The 29-year-old Yastrzemski is batting .265 with 19 homers and 65 RBI.
"He's got some of those qualities you like that may not show up on the spreadsheet, but he's good and he brings it every day," manager Bruce Bochy said.
Dubon homered leading off the third against starter Elieser Hernandez to break a scoreless tie. The 25-year-old rookie connected on a 1-0 slider that just cleared wall in left for his third homer.
Cueto gave up three hits, struck out two and walked two. The two-time All-Star has combined for 10 innings of four-hit ball in his two starts since coming off the injured list.
"I'm happy with the way things are going," Cueto said. "I feel healthy and I just want to continue working on what I need to work on for next year."
Giants reliever Tyler Rogers (2-0) struck out one in a 1-2-3 eighth for the win, and Will Smith worked around a walk and a wild pitch in the ninth for his 33rd save in 37 tries. The All-Star closer had been out since Sept. 6 with back tightness.
Jon Berti had two hits and one RBI and made a great defensive play for the Marlins, who have lost six of seven and are 11-34 since July 30.
Hernandez struck out a career-high nine in five innings of three-hit ball. He gave up one run and walked one.
"He got pretty good counts and was aggressive," Marlins manager Don Mattingly said. "I thought his stuff looked good today. He kind of shows you who he is and he's going to give you velocity as far as what you see, but the thing about him is that is that he was a Rule 5 guy last year and to this year, he's come a long, long way. And he's still a young kid."
The Marlins tied the game in the seventh on Berti's two-out, RBI single, which scored Magneuris Sierra from third. Sierra reached on a two-out infield hit and went to third on Longoria's throwing error from third.
Giants first baseman Belt bunted down the third base line against the shift for a hit leading off the sixth.
Berti made a leaping catch in left field, crashing into the top of the wall to rob Longoria of extra bases in the bottom of the first.
Marlins: RHP Jordan Yamamoto (right forearm strain) will pitch in an instructional league game on Monday and could join the rotation before the end of the season, manager Don Mattingly said.
Giants: OF Alex Dickerson (right oblique) appeared in Sunday's game as a pinch hitter and struck out in his only at-bat the fifth. Dickerson hadn't played since Sept. 3. ... Center fielder Kevin Pillar got an off day. . RHP Enderson Franco was selected from Triple-A Sacramento. . LHP Tony Watson (left wrist fracture) was placed on the 60-day injured list.
Marlins: RHP Pablo Lopez (5-8, 4.97 ERA) will open Monday's series opener against the Diamondbacks in Arizona.
Giants: RHP Logan Webb (1-2, 6.75 ERA) will make his sixth career start in Tuesday's series opener in Boston.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Correa HR in 11th, Astros top Yankees 3-2; ALCS tied at 1
Carlos Correa hit a leadoff home run in the 11th inning and the Houston Astros won a battle of the bullpens, beating the New York Yankees 3-2 Sunday night to tie the AL Championship Series at one game apiece.
Correa's RBI double gets Astros on the board
Carlos Correa hit an RBI double into left field past Gio Urshela to give the Astros a 1-0 lead over the Yankees in the second inning.
Yankees take the lead on Judge's 2-run jack
Aaron Judge hits a two-run home run over the center field wall in the fourth inning to give the Yankees a 2-1 lead over the Astros.
Springer mashes solo homer in the 5th
George Springer ties the game at 2-2 after crushing a solo home run to left center field in the fifth inning.
Correa throws out LeMahieu at home
Carlos Correa fields a misplayed ball in the infield and makes a throw to home plate just ahead of DJ LeMahieu to finish the top of the sixth inning.
Urshela elevates to rob Gurriel of a hit
Gio Urshela leaps into the air to snag a web gem to record the out on Yuli Gurriel.