He was also their only starter to win a game.
Wainwright permitted just one run and five hits in 6 1/3 innings Sunday in winning his fourth consecutive decision as St. Louis salvaged the series finale 8-3 at sold-out Busch Stadium.
In upping his record to 4-3, Wainwright walked three and fanned five, showcasing more swing-and-miss stuff than he has in almost every other start this year.
Wainwright struck out the side in the second to escape a two-on, none-out jam and attracted 13 swings and misses on his 109 pitches, departing after slipping a called third strike past pinch-hitter Michael Morse in the seventh.
"I ruined it for us," Wainwright joked about allowing the run. "I always feel like my best is about to come. I feel like there's a lot of things I can do better, but this was a good start."
Wainwright's start capped a terrific homestand for the Cardinals' starting rotation. Their 3-5 mark couldn't be blamed on the guys who opened the games. They gave up a combined 10 runs in 54 innings, yet St. Louis entered this one on a four-game losing streak.
Manager Mike Matheny thought the Cardinals left some wins on the field. They led in two midweek losses to the Boston Red Sox, blew a ninth-inning lead Friday night against San Francisco and wasted nine shutout innings Saturday night by Carlos Martinez in a 13-inning defeat.
"Some of those losses are hard to swallow," he said. "I definitely felt like we played better than our record shows on the homestand."
This one wasn't a missed opportunity, not with Wainwright pitching and not with the offense teeing off on a favorite mark.
Giants right-hander Matt Cain (3-2) entered the day with a 7.62 career ERA in St. Louis and it got no better as a result of his latest failure under the Gateway Arch.
In 5 1/3 innings, Cain was touched for nine hits and seven runs, walking three and striking out one. Cain departed after his mound opponent ripped a one-out double to the left-field wall in the sixth, scoring Aledmys Diaz for a 7-1 lead.
"He was just behind more than he's normally been this year," San Francisco manager Bruce Bochy said of Cain. "He battled, he competed, but as you could see, I thought it was just a case where he just wasn't as sharp as he's been."
It got away from Cain in the second. The Cardinals filled the bases with no outs for Randal Grichuk. Cain threw a fastball probably three inches inside, but Grichuk ripped it down the left-field line for a bases-clearing double.
One out later, Dexter Fowler scored Grichuk from third with a sacrifice fly for a four-spot that shaped the game's outcome.
"That's a good job on his side to be able to keep the ball fair," Cain said. "From my vantage point, it looked like it was right on the line, so that's a good piece of hitting. A big inning like that is tough to come back from."
Christian Arroyo doubled home Joe Panik in the third to pull the Giants (19-26) within 4-1, but Matt Carpenter walloped a two-run homer to right-center field in the fifth for a 6-1 advantage. Carpenter is now 9-for-18 with two homers in his career against Cain.
San Francisco received back-to-back homers from Brandon Crawford and Eduardo Nunez in the eighth, but Grichuk finished the scoring in the St. Louis half of the inning with a ground-rule double to left center that plated Diaz.
Diaz doubled twice and scored three runs for the Cardinals (22-19). Grichuk finished with a season-high four RBI.
NOTES: San Francisco INF Aaron Hill (right forearm strain) had his rehab stint transferred to Triple-A Sacramento from Class A San Jose on Saturday and went 1-for-2 with two runs scored in his first appearance for the Rivercats. ... St. Louis 2B Kolten Wong (left elbow discomfort), who left Saturday night's game in the fourth inning, didn't start. Greg Garcia replaced him in the lineup. ... Giants INF Conor Gillaspie (back spasms) went 1-for-4 Saturday night in his second rehab game with Sacramento.