SAN FRANCISCO -- Matt Carpenter has no explanation for the sudden turn of events, other than a little bit of luck and a lot of aggression.
"I wasn't as sharp as I was, for some reason, for the first three innings and it just kind of fell apart," Cain said. "I don't know that they changed anything. I just started making some bad pitches and they put good swings together."
"He was great the first time through the order and then I thought we did a good job the second time being aggressive," Carpenter said. "Guys were battling up there and things started to roll for us and a couple of balls fell in. We did a good job of swinging at good pitches."
According to research by the Elias Sports Bureau provided by the team, Cain was the first Giants pitcher to give up so many runs in a single inning since John Cronin on Sept. 27, 1902, in the second game of New York's doubleheader against Brooklyn.
"It's one of those innings we couldn't stop the bleeding and the game got out of hand there," Giants manager Bruce Bochy said. "I can't say there was anything different he was doing. They just threw out some pretty good at-bats."
Adam Wainwright (1-1) pitched seven innings, giving up two runs on seven hits for his first win since signing a rich new contract at the end of spring training. He struck out six and walked none.
"Pitching against Matt you have to take that 0-0 mentality," Wainwright said. "I cracked first and I thought I had to keep it there for us to have a chance. Our offense did an amazing job. Against a pitcher like that you never expect anything like that."
Cain pitched a perfect game last year and helped the Giants win their second title in three seasons. The pregame ceremony included the presentation of rings to Giants Hall of Famers Willie Mays, Willie McCovey, Orlando Cepeda, Juan Marchial and Gaylord Perry.
Cain retired the first nine batters, then gave up seven hits while getting just two outs in the fourth. Beltran, Carpenter and Matt Adams each drove in two runs during the outburst. Cain left after Carpenter's two-run single.
"I don't know what it is, every at-bat has been tough against him," said Carpenter, who is 6 for 7 lifetime against Cain. "All I can say he comes at me, gets ahead and I have to fight back into the count. He's as good as there is in the league."
Back in 2008, the Cardinals scored nine runs against Cain spread out over 3 2/3 innings.
Adams finished with three hits, including a two-run double in the fourth.
"I can't get over the two-strike, two-out hits we were putting together," Cardinals' manager Mike Matheny said. "If you're looking for a kind of offense, that's what we can be. It was a nice run there."
The Giants gave up their most runs in an inning since 2004 when Cincinnati scored 10 in the eighth.
The Cardinals' team record is 12 in an inning, accomplished last July.
Cardinals 3B David Freese was 3 for 5 with 2 RBIs in a rehab game with Triple-A Memphis. ... LHP Jamie Garcia (1-0, 1.59) starts Monday night for the Cardinals against Cincinnati. His eight wins against the Reds are his most against any team. ... LHP Madison Bumgarner (1-0, 0.00) starts for the Giants on Monday night against the Colorado Rockies. He has a career 2.39 ERA against the Rockies. ... Cain is 2-4 with a 6.18 ERA in nine starts against St. Louis. ... Cardinals RHP Joe Kelly was hit in the hand by Guillermo Quiroz's line drive that went for an RBI single in the ninth. He will have X-rays taken Monday in St. Louis.