SAN FRANCISCO (AP) -- Brandon Crawford hit a two-run single for his first RBIs since April and the San Francisco Giants capitalized on shoddy fielding by St. Louis to give Matt Cain support on a rare shaky day as the Giants beat the Cardinals 7-5 on Thursday.
St. Louis made three errors in a game for the second time this week with the most important coming in the sixth inning: Third baseman David Freese's errant throw on pinch-hitter Aubrey Huff's two-out grounder allowed Brandon Belt to score the go-ahead run.
First baseman Lance Berkman also made an error in the second inning to help lead to Crawford's two-run single. Three of the five runs scored off Adam Wainwright (2-5) were unearned.
Cain (3-2) has been plagued by poor run support for his entire career with the Giants scoring a major league-low 3.89 runs per game for him since his first big league season in 2006.
But with help from the Cardinals they managed to score five runs with Cain in the game on Thursday to make up for his rough start that included Matt Holliday's two-run homer in the third inning. San Francisco had its highest-scoring home game of the season.
Santiago Casilla pitched the ninth for his ninth save in 10 chances.
Cain came into the game with the second best ERA at home in the majors this season, having allowed four runs in 33 innings for a 1.09 mark. He allowed as many runs in the first three innings against the Cardinals as he had in his previous four starts here.
He allowed sacrifice flies by Holliday and Freese in the first inning and Holliday's two-run homer in the third to fall behind 4-3. Cain retired 10 of the final 11 batters he faced. He allowed four runs and eight hits in six innings.
Crawford doubled and scored on Buster Posey's single in the first and then hit his two-run single in the second for the Giants, ending a string of 16 straight games without driving in a run.
Cain ended up on the winning side when the Giants got two runs in the bottom of the sixth after Angel Pagan led off the inning with a single and went to third on Belt's double.
Emmanuel Burriss tied the game with a sacrifice fly. It looked like the game would stay that way when reliever Victor Marte got Huff to hit a grounder to third with two outs. But Freese's throw to first was high, allowing Belt to score from second on the error.
Wainwright allowed five runs - two earned - and eight hits in 5 2-3 innings and is winless in five career starts against the Giants.
San Francisco added two runs in the seventh off Kyle McClellan on Belt's RBI double and Charlie Culberson's groundout. McClellan left the game with a sore right elbow.
Yadier Molina hit a solo homer in the eighth for St. Louis for the first run of the season off reliever Sergio Romo.
NOTES: Cardinals OF Carlos Beltran (right knee) did not start for a fourth straight game. He popped out as a pinch-hitter in the ninth. ... Cardinals OF Allen Craig sat after tweaking his left hamstring Wednesday. ... Giants 3B Joaquin Arias missed his second straight game after being hit in the left forearm Tuesday. ... Lance Lynn (6-1) takes the mound for the Cardinals when they open a three-game series in Los Angeles against Ted Lilly (5-0) and the Dodgers. ... Former Oakland ace Barry Zito, who is 1-4 with a 7.24 ERA in five starts against his former team, starts the series opener of the first Bay Bridge series for the Giants against Jarrod Parker.