"I needed a game like that," the right-hander said.
Wainwright's best outing of the year, combined with a two-run double from Matt Holliday in the third inning, led the Cardinals to a 2-0 victory, snapping the Rockies' five-game winning streak.
Wainwright (4-3) came into the game having allowed at least three runs in all eight starts this season. Despite having won his last three decisions to even his record, he had an unusually ERA high, for him, 6.80. He allowed seven runs, six earned, in five innings in his last start against the Los Angeles Angels.
"I knew in the bullpen before the game that some of the things we had been working on had clicked into place," Wainwright said. "We've continued to build my leg strength, to make little adjustments to my delivery. I've continued to stay positive. When you stay positive, even when you are struggling, a lot of good things can come of that.
"There were a lot of lessons I learned going through that process. The thing I can control is making one pitch at a time and winning that first game. I just have got to keep making pitches."
Wainwright's 6 2/3-inning outing was his longest of the year. He scattered six hits, walked one and struck out five.
He had to pitch out of some jams early, including a leadoff triple to start the game, and an error by shortstop Aledmys Diaz on what should have been an inning-ending double play. He also stranded two runners in the third and a runner on third in the fourth.
Wainwright left with runners on first and third in the seventh, but Kevin Siegrist got a strikeout to end the inning, and he and Trevor Rosenthal preserved the shutout.
Rosenthal pitched a 1-2-3 ninth inning for his eighth save.
It was the first time this season the Cardinals won while scoring three runs or fewer. They were 0-12 before the game in those situations.
"That was the kind of start we've been hoping for," St. Louis manager Mike Matheny said. "It was exactly what we needed."
Wainwright made his biggest pitches when he needed them, keeping the Rockies hitless in nine at-bats with runners in scoring position. Colorado finished the game 0-for-10 with runners on second, third or both.
"We had a couple of opportunities especially early, but we never really got settled in," Rockies manager Walt Weiss said. "It looked like he changed speeds, used the breaking ball well. (We) just never got going against him.
"I know he hasn't been vintage Wainwright so far early this year, but he knows what he's doing out there. There's a lot of wisdom and a lot of feel of the pitch, and he still has a good arm and good stuff, and we saw that tonight."
Carlos Gonzalez was one of the Rockies' hitters who was victimized by Wainwright, twice flying out to leave runners on second base.
"So far his year's has not been very good," Gonzalez said. "But he's just one of those pitchers that's got a really good track record. He pitched like the old Wainwright today."
Holliday gave Wainwright the only runs he needed in the third. With one out, Chris Rusin walked Matt Carpenter and gave up a single to Stephen Piscotty, one of his three hits in the game. Holliday then continued to torment his original team with a two-run double down the left field line.
Holliday, drafted and signed by the Rockies, broke an 0-for-15 slump with his 36th and 37th career RBIs in 40 games against the Rockies.
Rusin (1-2) allowed just two runs on six hits in six innings. He walked two and struck out five.
Rusin has not won a start on the road since Aug. 9, 2013, at St. Louis, when he was with the Cubs. He fell to 0-10 in 18 road starts since that game. It was his fourth road start this season, and he was not involved in the decision in the first three.
NOTES: Rockies LHP Jorge De La Rosa is set to make a third start Thursday during a rehab assignment at Triple-A Albuquerque. De La Rosa, coming back from a groin injury, lasted a combined 7 2/3 innings in his first two rehab starts. ... Cardinals SS Jhonny Peralta, out since undergoing surgery on his left thumb in spring training, took batting practice on the field for the first time before Wednesday night's game and could go on a rehab assignment next week. ... RHP Alex Reyes, the Cardinals' top prospect who has been serving a 50-game suspension for testing positive for marijuana, is set to make his season debut on Sunday for Triple-A Memphis. ... The Cardinals' home game on June 5 vs. the Giants has been switched from a day game to 7:05 p.m. CT so it can be televised by ESPN.