Adam Frazier tripled home the tying run in the 11th inning with his fourth hit of the game and scored the winner on Gregory Polanco’s sacrifice fly as the Pittsburgh Pirates rallied for a 3-2 victory over the San Francisco Giants on Friday night.

After Austin Slater’s single put the Giants ahead in the top of the 11th, Frazier led off the bottom half with his hit high off the 21-foot Clemente Wall in right field. That scored Michael Perez, who began the inning as the automatic runner on second base.

More Images
Pittsburgh Pirates' Gregory Polanco celebrates as he runs to first base after driving in the winning run with a sacrifice fly off San Francisco Giants relief pitcher Caleb Baragar during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. The Pirates won 3-2. (AP PhotoGene J. Puskar)

Adam Frazier tripled home the tying run in the 11th inning with his fourth hit of the game and scored the winner on Gregory Polanco’s sacrifice fly as the Pittsburgh Pirates rallied for a 3-2 victory over the San Francisco Giants on Friday night.

Pittsburgh Pirates' Gregory Polanco tosses his bat after driving in the winning run with a sacrifice fly off San Francisco Giants relief pitcher Caleb Baragar during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

The comeback gave rookie reliever Luis Oviedo (1-1) his first major league win.

San Francisco Giants' Brandon Crawford watches his solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

San Francisco starter Kevin Gausman took a three-hit shutout into the ninth but could not finish it. He was pulled by Kapler after giving up back-to-back singles to Frazier and Newman to start the inning.

San Francisco Giants starting pitcher Kevin Gausman delivers during the first inning of a baseball game against the Pittsburgh Pirates in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Gausman allowed five hits and no walks while throwing 96 pitches. He has pitched at least six innings in all eight starts this season and yielded more than one run only once.

San Francisco Giants' Austin Slater drives in a run with a single off Pittsburgh Pirates relief pitcher Luis Oviedo during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Yajure pitched five scoreless innings and allowed only one hit, a third-inning single by Gausman, in his second career start. Throwing just 57 pitches, Yajure had four strikeouts and one walk.

San Francisco Giants' Brandon Crawford hits a solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021.(AP PhotoGene J. Puskar)

TRAINER’S ROOM

Pittsburgh Pirates relief pitcher Duane Underwood Jr. collects himself after giving up a solo home run to San Francisco Giants' Brandon Crawford during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

ROSTER MOVES

San Francisco Giants relief pitcher Tyler Rogers delivers during the 10th inning of the team's baseball game against the Pittsburgh Pirates in Pittsburgh, Friday, May 14, 2021.(AP PhotoGene J. Puskar)

UP NEXT

San Francisco Giants' Brandon Crawford celebrates as he crosses home plate on a solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

San Francisco Giants' Brandon Crawford celebrates as he crosses home plate on a solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Pittsburgh Pirates starting pitcher Miguel Yajure delivers during the first inning of the team's baseball game against the San Francisco Giants in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Pittsburgh Pirates starting pitcher Miguel Yajure delivers during the first inning of the team's baseball game against the San Francisco Giants in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Kevin Newman lined out softly and Giants manager Gabe Kapler had Caleb Baragar intentionally walk Bryan Reynolds and rookie Will Craig to load the bases. Polanco foiled the strategy by hitting a deep fly to center field.

Pittsburgh Pirates' Gregory Polanco celebrates as he runs to first base after driving in the winning run with a sacrifice fly off San Francisco Giants relief pitcher Caleb Baragar during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. The Pirates won 3-2. (AP PhotoGene J. Puskar)

Pittsburgh Pirates' Gregory Polanco celebrates as he runs to first base after driving in the winning run with a sacrifice fly off San Francisco Giants relief pitcher Caleb Baragar during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. The Pirates won 3-2. (AP PhotoGene J. Puskar)

The comeback gave rookie reliever Luis Oviedo (1-1) his first major league win.

NL West-leading San Francisco (23-15) missed a chance to move 10 games over .500 for the first time since 2016. Pittsburgh won for just the fourth time in 15 games.

Reynolds’ run-scoring single in the ninth tied the score 1-all and sent the game to extra innings.

Pittsburgh Pirates' Gregory Polanco tosses his bat after driving in the winning run with a sacrifice fly off San Francisco Giants relief pitcher Caleb Baragar during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Pittsburgh Pirates' Gregory Polanco tosses his bat after driving in the winning run with a sacrifice fly off San Francisco Giants relief pitcher Caleb Baragar during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

San Francisco starter Kevin Gausman took a three-hit shutout into the ninth but could not finish it. He was pulled by Kapler after giving up back-to-back singles to Frazier and Newman to start the inning.

Giants closer Jake McGee relieved with runners on first and third and was greeted by Reynolds’ hit to right field. McGee then struck out Craig, Polanco and Erik Gonzalez to end the threat.

While Gausman missed out on his first career shutout in the 172nd start of his nine-year career, he did set a personal best with 12 strikeouts. He previously had two 11-strikeout games, including April 24 against Miami.

San Francisco Giants' Brandon Crawford watches his solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

San Francisco Giants' Brandon Crawford watches his solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Gausman allowed five hits and no walks while throwing 96 pitches. He has pitched at least six innings in all eight starts this season and yielded more than one run only once.

Brandon Crawford broke a scoreless tie with a leadoff homer in the eighth to the first row of seats in right field off Duane Underwood Jr.

The Giants managed just four hits against rookie Miguel Yajure and Pittsburgh’s bullpen and did not have a plate appearance with a runner in scoring position.

San Francisco Giants starting pitcher Kevin Gausman delivers during the first inning of a baseball game against the Pittsburgh Pirates in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

San Francisco Giants starting pitcher Kevin Gausman delivers during the first inning of a baseball game against the Pittsburgh Pirates in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Yajure pitched five scoreless innings and allowed only one hit, a third-inning single by Gausman, in his second career start. Throwing just 57 pitches, Yajure had four strikeouts and one walk.

Pittsburgh called up Yajure from Triple-A Indianapolis to make what was expected to be a spot start. The move was made to give the other starting pitchers extra rest.

The Pirates were 0 for 5 with four strikeouts against Gausman with runners in scoring position. He also set down Pittsburgh in order the first time through the lineup.

San Francisco Giants' Austin Slater drives in a run with a single off Pittsburgh Pirates relief pitcher Luis Oviedo during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

San Francisco Giants' Austin Slater drives in a run with a single off Pittsburgh Pirates relief pitcher Luis Oviedo during the 11th inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

TRAINER’S ROOM

Giants: Crawford (COVID-19 vaccination effects) and 1B Brandon Belt (left side tightness) returned to the lineup after missing Thursday’s game. … RF Alex Dickerson (bone bruise in left shoulder) is expected to be activated from the injured list Sunday, the first day he is eligible.

Pirates: GM Ben Cherington said rookie 3B Ke’Bryan Hayes (left wrist strain) continues to progress and is getting closer to a rehab assignment, but a firm timetable for his return to game action has not been set. … RHP Chad Kuhl (right shoulder discomfort) pitched a two-inning simulated game Thursday.

San Francisco Giants' Brandon Crawford hits a solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021.(AP PhotoGene J. Puskar)

San Francisco Giants' Brandon Crawford hits a solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021.(AP PhotoGene J. Puskar)

ROSTER MOVES

The Pirates optioned RHP Geoff Hartlieb to Indianapolis to open a roster spot for Yajure. Hartlieb has made one major league relief appearance this season, allowing three runs in two innings.

RHP Michael Feliz, who had been designated for assignment by Pittsburgh, was claimed off waivers by Cincinnati.

Pittsburgh Pirates relief pitcher Duane Underwood Jr. collects himself after giving up a solo home run to San Francisco Giants' Brandon Crawford during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Pittsburgh Pirates relief pitcher Duane Underwood Jr. collects himself after giving up a solo home run to San Francisco Giants' Brandon Crawford during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

UP NEXT

Giants RHP Johnny Cueto (2-1, 3.52 ERA) gets the start Saturday night against Pirates LHP Tyler Anderson (3-3, 3.05). Cueto is 21-4 with a 2.13 ERA in 31 career starts against the Pirates, though he lost to them in the 2013 NL wild-card game. Anderson spent last season with the Giants.

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports

San Francisco Giants relief pitcher Tyler Rogers delivers during the 10th inning of the team's baseball game against the Pittsburgh Pirates in Pittsburgh, Friday, May 14, 2021.(AP PhotoGene J. Puskar)

San Francisco Giants relief pitcher Tyler Rogers delivers during the 10th inning of the team's baseball game against the Pittsburgh Pirates in Pittsburgh, Friday, May 14, 2021.(AP PhotoGene J. Puskar)

San Francisco Giants' Brandon Crawford celebrates as he crosses home plate on a solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

San Francisco Giants' Brandon Crawford celebrates as he crosses home plate on a solo home run off Pittsburgh Pirates relief pitcher Duane Underwood Jr. during the eighth inning of a baseball game in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Pittsburgh Pirates starting pitcher Miguel Yajure delivers during the first inning of the team's baseball game against the San Francisco Giants in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)

Pittsburgh Pirates starting pitcher Miguel Yajure delivers during the first inning of the team's baseball game against the San Francisco Giants in Pittsburgh, Friday, May 14, 2021. (AP PhotoGene J. Puskar)