SAN FRANCISCO -- Matt Cain shook his head and smiled when talking about Pablo Sandoval's return to the lineup on Friday night.
"He just wakes up and hits," Cain said. "I don't understand how he does it, but he does it."
Fred Lewis and Emmanuel Burriss also drove in runs for the Giants, who won their fourth straight and fifth in six games overall.
Sandoval sat out four games with tightness in his right elbow and started at first base for the first time.
"I didn't realize he was playing first until we took the field," Burriss said. "He doesn't play for a few days and he comes in and gets a couple of knocks. We didn't expect anything less."
Burriss added a key defensive play at second base in the seventh, when he snared Chris Duncan's low liner with two outs and a runner on.
"It was hit hard and all I had time for was a dive," he said. "In terms of range it wasn't that far."
Juan Uribe at third and Edgar Renteria at short also ranged wide to make nice plays against Albert Pujols and Ryan Ludwick to open the eighth.
"Those were plays that wins ballgames," Giants manager Bruce Bochy said. "Our defense really stepped up."
Cain (6-1) was the main benefactor of the solid play. He gave up two runs - one earned - on six hits in 6 1/3 innings. He walked two and struck out five. He's won his past four decisions.
"You try to build off the momentum of your last start," Cain said. "The big thing is the guys are going out and scoring early. That's a big confidence booster when you can go out there with a lead."
Cain has pitched at least six innings in all 10 of his starts and allowed two or fewer runs in eight of them. He retired nine of the first 10 batters he faced.
"Matt has been locked in from Day One," Bochy said. "He's locating better and has that focus. He has a look about him on the mound."
Jeremy Affledt got the final two outs of the seventh, Bob Howry pitched a perfect eighth and Brian Wilson worked the ninth for his 11th save in 14 chances.
"We have the confidence that if we do have the lead we can hold it," Wilson said. "When the starters are going six innings, the bullpen knows their roles. When you start playing as a team, collecting hits, playing defense, as a whole you're playing better and that's what you're seeing right now."
Pujols had two hits and scored a run for the Cardinals, who lost for the third time in 10 games. Colby Rasmus drove in a run and Ludwick, in his first game back off the disabled list, scored on a throwing error.
"[Cain] throws 94-95 [mph] for one and then he's got a slider, the changeup and the big slow curveball," Ludwick said. "What made him tough for me is he got the curveball over twice. First pitch for a strike and then you're in the hole against a guy that's got good stuff."
Joel Pineiro (5-5) pitched a season-low four innings, allowing four runs on six hits with a walk and three strikeouts.
"Whenever I left the ball up I got hurt," Pineiro said. "I was a little bit surprised when I came out, I thought I still had stuff to go back out there and give them another inning or two."
Pineiro hasn't had much success at the Giants' new ballpark in two starts. He's given up 10 earned runs in 7 2/3 innings here. He was looking to become the first pitcher since Greg Maddux in 1995 to record five straight starts of no walks and no home runs.
Aaron Rowand, who has hit safely in all nine games since assuming the leadoff spot, doubled to open the first.