With a 2-2 score, two out and Marco Scutaro on first in the fifth, Hunter Pence popped one up to second base, but LeMahieu lost it because of the wind, letting Pence reach first on an error and advancing Scutaro to third. The next batter, Brandon Belt, took advantage and clubbed a two-run double to deep center field, just over Dexter Fowler's glove for a 4-2 lead. Belt scored on Andres Torres' double to the right-field corner, making it 5-2.
Just like that, the Giants (28-22) took two out of three from the Rockies (27-23) in the finale of their six-game homestand.
"When it went up with the wind -- I saw other people catching fly balls -- I knew it wasn't going to stay straight, and once it got above the stadium, the wind took it," LeMahieu said. "I tried to keep my feet moving, but I misjudged it completely."
The Giants did not score in the series opener Friday and not until the sixth inning of their 10-inning win Saturday. On Sunday, they trailed until the fourth, when Belt (1-for-2, two walks, two runs) led off with a walk, Torres followed with a single to advance Belt to third, and Brandon Crawford plated Belt, reaching on a fielder's choice, tying it at 2 apiece.
Cain's 1-2-3 third and fourth innings -- and the fact that he allowed only two runs and two hits in five innings, despite five walks, all in the rough first and second frames -- seemed impossible the way his afternoon began.
Cain (4-2) loaded the bases on three walks to the first four batters, then the fifth, Michael Cuddyer, lined a two-run double to left field for a 2-0 Rockies lead. Pitching coach Dave Righetti visited the mound, then Cain struck out Todd Helton and got Wilin Rosario to line out to end the 38-pitch first frame.
In the second, Cain walked the first batter, and with one out, walked Fowler -- Cain's fifth walk, more than he had in any outing this season. But Cain struck out Rockies slugger Carlos Gonzalez to end the second -- his 65th pitch and the second of three strikeouts of Gonzalez.
San Francisco's bullpen was warming up, but Cain stayed in. The last time Cain walked five batters was Sept. 14, 2012. Before that, you'd have to go back to May 12, 2010.
Cain battled Sunday. Even when he allowed a leadoff double to Fowler in the fifth, he got three consecutive outs, the last one a close groundout by Troy Tulowitzki with Fowler sprinting home from third base.
"That game was all about Matt Cain and him settling down to give us five innings," manager Bruce Bochy said.
Added Colorado manager Walt Weiss: "I felt like we had Cain in trouble early, the first couple of innings. But to his credit, a lot like he did at our place, he bent, but he didn't break. He's one of the better pitchers in the league, and there's a reason for it. He battles."
Of Rockies starter Jon Garland's five runs allowed, only two were earned, but he wasn't perfect. San Francisco tallied seven hits and four walks, and chased Garland (3-6) after five innings, adding two runs in the seventh on Pence's two-run double off reliever Edgmer Escalona.
Center fielder and leadoff hitter Angel Pagan got the day off because of a left hamstring strain, so left fielder Gregor Blanco filled his spots, and Torres got the start in left. Batting seventh, Torres went 2-for-4 with one RBI. He has eight hits in his last 18 at-bats with four doubles and three RBIs.
"I just try to be myself," Torres said. "Whenever they need me, I want to help."
The Rockies have two of the game's top hitters in Gonzalez and Tulowitzki, but they combined to go 0-for-9 with six strikeouts and one walk in the series finale. Gonzalez has struggled against Cain, entering with a .114 average in 35 at-bats.
"Give Cain credit for making really good pitches," said catcher Buster Posey, who hit a solo homer in the second inning.
Cain -- and the wind. Credit belongs where credit is due.