"We needed a win," manager Tony La Russa said. "When you haven't been winning, boy, it's hard to win games. And then when you're winning, it's hard to lose. It was really a struggle. Probably for one game that could be some of the worst at-bats that we've had. Guys are pressing so much. We just have to find a way to relax."
Wainwright had a career-high 12 strikeouts, seven of which came from the seventh inning on. He almost made a lone RBI single by Ryan Ludwick in the first inning stand up as he took a 1-0 shutout into the eighth. But he ran into trouble after two hits and a walk loaded the bases with no outs for the Giants' hottest hitter, Pablo Sandoval.
Sandoval worked the count full before Wainwright got him swinging with a nasty curveball in the dirt for the first out of the inning.
"He's an aggressive hitter," Wainwright said. "The guy puts breaking balls in play that are strikes. He puts anything in play that's a strike, really. So it's a 3-2 count, let's just throw the best curveball you got in the dirt and take your chances. You know we're up by one and we need a strikeout there.
"There are certain situations like that where you know guys are ready to swing the bat. You play into their aggressiveness a little bit."
Wainwright gave up a sacrifice fly to Bengie Molina to tie the game before striking out Nate Schierholtz to end the inning. Instead of heading for the showers with 105 pitches, Wainwright surprised some when he trotted back out for the ninth.
But with the score still tied at 1, Wainwright gave up a leadoff single to Edgar Renteria before striking out the next three batters to send the game to the bottom of the ninth. It was Wainwright's seventh start of at least 110 pitches.
The righty did everything he could to help keep his team in the game. He was rewarded an inning later.
"What Adam did was heroic," La Russa said. "Against a club as hot as they are, shut them down, shut them down and then to have that jam in the eighth. That game has to get away from us there. And how he pulled that out and then he came back in the ninth, he was heroic.
"He's very special."
Wainwright was allowed to go nine innings and 122 pitches because he will have an extra day before his next start Tuesday and also because he throws fewer pitches warming up before a game than any other pitcher.
It didn't hurt that he was throwing his best at the end of the game either.
Rasmus' winner came two pitches after Sandoval dropped a foul popup at third that would have ended the at-bat and sent the rookie back to the dugout.
"There was no excuse," Sandoval said. "I have to catch that ball, 100 percent."
The next pitch was a borderline 2-2 fastball that Rasmus took just low for a ball. With Albert Pujols waiting on deck, Giants reliever Bob Howry gave Rasmus a 3-2 fastball that he promptly deposited into the seats to send the Cardinals home a winner.
The walk-off homer was the first by a Cardinals rookie since Andy Van Slyke ended a game on Aug. 18, 1983, against Houston.
Given a new life, Rasmus didn't let his second opportunity get away.
"I guess you could say that," Rasmus said. "I didn't really think much about that. I just tried to relax and stick to my game plan of what I was trying to do and not swing at that split-finger [fastball] in the dirt.
"I don't think it really gets much better than that. I was battling trying to get a good pitch to hit and just trying to stay with him, and I got lucky and came through."
The Cardinals had a chance to go ahead in the bottom of the eighth but Joe Thurston -- stuck in a 6-for-55 slump that has dropped his batting average to .219 -- struck out with the bases loaded to end the inning.
The Cardinals send struggling righty Todd Wellemeyer to the mound on Thursday night as they try to earn a split of the four-game series.
But just how can the struggling Cardinals offense settle down and take better at-bats at the plate so that a nine-inning, one-run performance by their starter won't leave him with a no-decision again?
"Maybe have a pool party in our whirlpool about 5 o'clock and let them drink some iced tea and bring in a comedian and make them laugh," La Russa said. "Because they are just pressing. That's all it is. They'll be all right."