So rarely over the past month have the Giants come up with the big hit.

In the ninth inning Monday night, down one run with two men on base, Patrick Bailey broke the trend.

The switch-hitting rookie catcher poked a blooper into left field that sent Randal Grichuk tumbling toward the foul line, allowing the ball to sneak past and for Wilmer Flores and J.D. Davis to race home and score the tying and go-ahead runs of an eventual come-from-behind 8-3 win over the Angels.

The ninth-inning meltdown by closer Carlos Estevez allowed the Giants to pick up their first win in their past nine games away from Oracle Park and sent the home team to its seventh straight loss since the trade deadline. Ironically, thanks to a two-RBI poke from newcomer Mark Mathias and two more insurance runs in a six-run ninth inning, one of the Giants’ most dramatic comebacks snapped a streak of nine straight games decided by two or fewer runs.

The Giants had not had a rally of four or more runs in one inning since mid-June.

Flores singled to lead off the inning for his second hit of the night. Davis walked, reaching base for the third time. And Bailey, batting left-handed, went the other way with a middle-in slider from Estevez, also his third time on base after reaching four times Sunday.

Until the floodgates opened in the ninth, it appeared that another lackadaisical offensive effort and a couple defensive miscues were going to cost them.

A.J. Pollock, acquired along with Mathias at the trade deadline, misplayed a fly ball in the seventh, allowing the Angels to score the go-ahead run, only an inning after the Giants were charged with two errors on the play that tied the game, when Luis Matos and Patrick Bailey both had trouble handling the baseball.

Logan Webb limited the Angels to two runs (one earned) but was forced from the game with two outs in the fifth.

The Angels fouled off 29 of Webb’s 106 pitches, running his pitch count into triple digits by the middle of the sixth inning.

Cron smoked the 103rd pitch into left field, tying the score at 1, and Mickey Moniak spelled an end to Webb’s night on his 106th offering, lining it up the middle to score Cron to give the Angels their first lead, 2-1. It was only the fifth time in 24 starts this season that Webb has failed to complete six innings.

Cron scored from first, and it initially looked to be an aggressive send by Angels third base coach Bill Haselman.