Follow CBSMIAMI.COM: Facebook | Twitter

SAN FRANCISCO, Calif. (The Sports Xchange) — Already with three hits under his belt in a ballpark where he’d never previously had even one, Miami Marlins catcher J.T. Realmuto decided to shoot for the moon in the eighth inning of a tie game Sunday.

READ MORE: Erika Verdecia's Confessed Murderer Eric Pierson Had Other Victims

He missed, fouling a Josh Osich pitch straight back.

Realmuto then lowered his target and connected, belting a home run that propelled the Marlins to a 5-4 victory over the San Francisco Giants.

“Hitting is extremely contagious,” Realmuto insisted after helping prevent the Giants from recording what would have been their first three-game home sweep of the Marlins since 2001. “Today we showed that.”

Realmuto, who entered the game 0-for-15 in his career at AT&T Park, hit the eighth pitch delivered by Osich (0-1) into the left-field bleachers for his first home run of the season and 11th of his three-year career, giving the Marlins a 5-4 lead.

The catcher earlier had two singles and a double, and finished 4-for-4, his second career four-hit game. The other came last season on June 5 at Colorado.

“It’s nice to come out here and explode today,” he said more about his team, which banged out 14 hits, than his own success. “Hopefully we can keep this going.”

Kyle Barraclough (1-0) got the win and A.J. Ramos the save, but right-hander David Phelps arguably deserved both when he bridged the gap between the two with a dramatic eighth-inning performance that preserved the 5-4 advantage.

Phelps, the fifth Marlins pitcher, was called upon in the bottom of the eighth to protect the one-run lead and issued walks to Brandon Crawford and pinch hitter Denard Span sandwiching a single by Gregor Blanco.

However, the right-hander turned a comebacker by Angel Pagan into a home-to-first double play, then struck out Joe Panik to escape unscathed.

“I was warming up when J.T. hit the homer,” Phelps explained. “That got me pretty pumped up. I was overthrowing everything at first.

“Once I started throwing strikes, I was OK.”

Barraclough pitched a scoreless seventh inning. Ramos, the closer, tossed a one-hit ninth for his third save.

The Marlins, who were thumped 8-1 and 7-2 in the first two games of the series, held 2-1 and 4-2 leads early in the series finale. Giancarlo Stanton’s solo home run, his fourth of the season, put Miami up 2-1 in the fourth.

“Everyone contributed,” noted Stanton, who had been 0-for-8 in the first two games of the series. “That’s important for us, instead of just one guy doing it.”

READ MORE: 'Public Service Is In My DNA': Ousted Miami Police Chief Art Acevedo On His Firing & COVID-19 Vaccine Mandates

Left fielder Christian Yelich drove in two runs, threw out Pagan at the plate in the fifth inning and lined a ninth-inning single that allowed him to reach base for the 17th consecutive game to open the season.

Stanton finished with three hits. Dee Gordon collected two hits, two stolen bases and two runs, and Marcell Ozuna added two hits for the Marlins, who totaled 14 hits against five Giants pitchers en route to just their third win in their last 11 games.

“You never know where it starts,” Marlins manager Don Mattingly said of the possibility of turning around the club’s slow start. “It seems like every win we’ve gotten has been a good one. Then we’ve had some chances and never took advantage of them.

The Giants rallied to tie the score at 4 with a two-run sixth inning, knocking out Marlins starter Adam Conley in the process.

After Conley left with two on and two outs, pinch hitter Brandon Belt greeted right-handed reliever Bryan Morris with a run-scoring single to get the Giants within one.

Pagan then drove in Blanco with a single to produce a 4-4 tie.

The Giants left the potential go-ahead run in scoring position in both the sixth and seventh innings. They managed just four runs despite 12 hits and six walks.

“You like to get greedy and get the last one,” Giants manager Bruce Bochy said of the possible series sweep. “This is one we all feel we let get away.”

Conley was charged with all four runs in his 5 2/3 innings. He allowed seven hits and four walks while striking out two.

Giants starter Matt Cain also didn’t factor into the decision. He went 5 2/3 innings, allowing four runs on 10 hits. He walked two and struck out four.

Hunter Pence delivered one of San Francisco’s first two runs with a fourth-inning solo home run. It was just Giants’ third home run in their past 10 games.

Pence, Pagan, Panik and Blanco had two hits apiece for the Giants, who last swept a three-game series from the Marlins on May 4-6, 2010 in Miami.

“You can look back at the last couple of nights,” Panik said when looking for a silver lining following the defeat. “Anytime you have a chance like this, you’d like to finish it off.”

NOTES: Marlins RF Giancarlo Stanton provided a pregame highlight when he belted what is believed to be the first ball ever to clear the AT&T Park bleachers in left field. The ball landed in a children’s play area an estimated 500 feet from home plate and bounced into the players’ parking lot, where it was retrieved by a parking-lot attendant. … Giants RHP Matt Cain gave up his 12th fifth-inning run of the season on a pair of hits. Opponents are hitting .667 (16-for-24) against him in the inning. … The Giants are now 1-10 when they’ve been out-hit in a game, and 8-0 when they have out-hit their opponent. … The Marlins expect to have 3B Martin Prado (paternity leave) back in the lineup during their four-game series in Los Angeles against the Dodgers that begins Monday night.

MORE NEWS: Accused Hollywood Cop Killer Jason Banegas Transferred To Broward Jail

(© Copyright 2016 The Sports Xchange. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)