SAN FRANCISCO -- Somewhere between St. Louis and San Francisco, David Freese found his swing, and Jaime Garcia was the beneficiary.
Freese broke out of his slump in a big way by collecting three hits, including the go-ahead home run, in leading the St. Louis Cardinals past the San Francisco Giants, 4-1, on Wednesday night.
"That was a big hit for Jaime," Freese said. "He pitched his tail off and it was nice to help get him a win."
Freese was hitless in his previous 17 at-bats before singling in the fourth. He was thrown out trying to stretch it into a double.
In the seventh, Freese lined a homer over the left-field fence, assuring himself a hazard-free trip around the bases. He also hit a ninth-inning double.
"I've been terrible the last week," he said. "You just show up every day and keep working. I've been flying open for a week, and when you do that, you might as well not even bring a bat to the plate. I've been trying to find it all week."
Maybe all he needed was a change of scenery.
"He hit the ball in the gap and got something positive," Cardinals manager Mike Matheny said. "He's so hard on himself. He's a perfectionist and takes it personal when he thinks he's not doing what the team needs him to do."
Skip Schumaker added a two-run, pinch-hit double in the eighth.
"One of the toughest things to do is pinch-hit," Schumaker said. "Coming off the bench cold, I was just trying to put something in the air. I lucked out and got enough of it."
Allen Craig, who left the game after batting in the eighth, also drove in a run for the Cardinals, who won their second straight following a four-game losing streak. Rafael Furcal added three hits.
"His leg didn't feel quite right," Matheny said of Craig. "Plus the defensive move was there."
Furcal, who will get a scheduled day off Thursday, upped his batting average to .370 with his ninth three-hit game of the year.
"He's a sparkplug and has been great for this club," Matheny said. "He's thriving on that leadoff role. He likes being the guiy who gets on base."
Garcia (3-2) didn't need much offensive help as he allowed nine hits to win for the first time in nearly a month and record his 30th career win. He retired 15 of the first 18 hitters he faced before allowing a run in the sixth.
"I was able to stay in control of the game and just worried about one pitch at a time," said Garcia, who allowed 11 runs in his last 18 1/3 innings. "I've been watching video and working on figuring out what I needed to do."
Matheny said Garcia found a groove from the first pitch on and remained in a nice rhythm.
"It was nice for him to get going like that," said the manager. "If he does that, he'll be fun to watch. He's the complete package."
Garcia did not walk a batter and matched his career high in strikeouts with nine over 7 1/3 innings, just off his longest outing of the season.
"He was smart," Giants manager Bruce Bochy said. "He expanded the strike zone and we chased it."
Garcia left the game after the Giants put two runners on in the eighth with one out. Fernando Salas got Buster Posey to fly out deep to right and Marc Rzepczynski needed one pitch to retire pinch-hitter Melky Cabrera.
Jason Motte pitched the ninth for his seventh save.
Rick Eymer is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.