Ed Szczepanski-USA TODAY Sports

Ezequiel Tovar broke a seventh-inning tie with a three-run home run, Ryan McMahon added a two-run shot and the Colorado Rockies snapped a four-game losing streak by beating the host San Francisco Giants 5-2 on Friday night.

Austin Gomber (7-7) pitched six effective innings to record his third straight win for the Rockies.

Colorado appeared to be on the verge of falling behind 3-2 in the last of the sixth, but center fielder Brenton Doyle caught a J.D. Davis fly ball and gunned down Austin Slater at the plate for an inning-ending double play.

Five batters later, Colorado took the lead instead. Walks to Randal Grichuk and Doyle set up Tovar, who teed off on Tyler Rogers' first pitch for his ninth home run of the season.

Three Rockies pitchers protected the lead with hitless relief, with Daniel Bard working a 1-2-3 ninth for his first save in the opener of a three-game series.

Colorado never trailed in the game after McMahon smacked the 10th pitch of a marathon at-bat against Giants opener Ross Stripling for his two-run homer in the top of the first. Kris Bryant, who had reached base on an infield single, scored ahead of McMahon, whose homer was his 14th.

Gomber took a two-hit shutout into the sixth, but Brandon Crawford followed a leadoff single by Casey Schmitt with a two-run homer of his own, tying the score. It was Crawford's fifth home run of the season.

Gomber was pulled after the Rockies took the lead back in the top of the seventh, having allowed two runs and five hits in six innings. He struck out one and did not walk anyone.

Taylor Rogers (4-3), who walked two of the four men he faced before watching his brother Tyler give up the tie-breaking home run, was charged with the loss.

McMahon and Grichuk had two hits apiece for the Rockies, who were swept in a three-game home series by the Giants last month.

Wilmer Flores had two hits for the Giants, who were out-hit 9-5. The hosts were held to two runs or fewer for the third straight game.

The loss was San Francisco's fifth in its last six games.

More must-reads:

TODAY'S BEST
Dodgers add recently acquired left-hander to active roster
Report: 2023 No. 7 pick expected to terminate KHL contract, join Flyers
Mavericks advance to Western Conference Finals aided by controversial call late
Connor McDavid, Oilers hammer Canucks to force Game 7
Tyson Fury-Oleksandr Usyk epic increases excitement for potential rematch
Seize the Grey wins in muddy Preakness
Even Mike Budenholzer admits the Suns need a point guard
Watch: Juan Soto's first multi-homer game as a Yankee
Xander Schauffele, Collin Morikawa lead at PGA Championship
Knicks could get major boost for Game 7 showdown with Pacers
Giants All-Star pitcher suffers setback in recovery from injury
Panthers star named winner of 2024 Selke Trophy
WNBA to investigate $100,000 sponsorship deals for Aces players
Tiger Woods blames one big factor for missing the cut at PGA Championship
'Ain't good enough': Draymond Green claims Celtics must 'win it all' or it's a 'failure'
Blue Jays GM wants struggling club to feel 'massive sense of urgency'
Raptors expected to flip former NBA champion during the offseason
MLB insider reveals Mets' massive extension offer that Pete Alonso turned down
Celtics legend provides update after gruesome finger injury
Bulls hire former NBA head coach as top assistant

Want more Rockies news?

Join the hundreds of thousands of fans who start their day with Yardbarker's Morning Bark, the best newsletter in sports.