Wainwright (10-3) retired his first 11 batters before David Wright's single, and allowed four hits with six strikeouts and two walks. Wainwright matched his career best by winning his fifth straight start, dropped his ERA to 2.18 and got his 1,000th career strikeout when Wright was called out on a first-inning curveball.
Known best in New York for freezing Carlos Beltran with a called third strike to end Game 7 of the 2006 NL championship series, Wainwright had been 0-4 with an 8.46 ERA in four starts against the Mets since beating them on April 18, 2010.
Trevor Rosenthal pitched the eighth, and Edward Mujica allowed a long home run to Marlon Byrd with one out in the ninth. John Buck then doubled and took third as Kirk Nieuwenhuis grounded to second baseman Matt Carpenter, who made a diving backhand stop as he fell and threw to first for the out.
Josh Satin, who had his first big league at-bat of the season a night earlier, fouled off two full-count pitches and then swung over a splitter as Mujica remained perfect in 19 save chances.
Harvey (5-1) had been unbeaten in 14 starts since Sept. 12 and he pitched well enough to win, giving up one run and five hits in seven innings with seven strikeouts and a walk.
St. Louis scored its only run off him in the third, when Pete Kozma hit a one-out, opposite-field single to right for the first hit of the game and Carpenter tripled past Byrd, who tried for a sprawling catch in right but allowed the ball to bounce past him.
New York's bullpen gave up a run in the eighth, when Carpenter and Beltran singled off Scott Rice, and Matt Holliday and Allen Craig singled against LaTroy Hawkins. Craig's RBI was his 49th of the season.
Craig made a diving stop at first base in the bottom half to rob Omar Quintanilla of a hit, just before Wright singled for his third hit.
Harvey, who lowered his ERA to 2.04, had no-decisions in eight of previous nine starts, and the Mets have scored just 18 runs while he's been in the game during his last 10 outings, according to STATS. He opened impressively, striking out Beltran for the second out of the game with three 97 mph fastballs. He shook off a second-inning comebacker by Yadier Molina that struck him on the left foot.
His next scheduled start is Tuesday's day-night doubleheader, when right-hander Zack Wheeler is to make his major league debut for the Mets. The highly touted Wheeler was making his last minor league outing for Triple-A Las Vegas against Tacoma later Thursday.
Under dark skies and with heavy rain forecast, an announced crowd of 25,471 that seemed much smaller watched the Mets lose for the eighth time in 10 games following a five-game winning streak. The Cardinals took two of three in the series and improved the big leagues' best record to 43-23.
Wainwright was perfect before Wright dumped a 2-2 curveball into center field for a single, a pitch after first base umpire Hunter Wendelstedt gave the Mets captain the call on a checked swing - Wainwright had started to walk off the mound, anticipating strike three.
Daniel Murphy took four straight balls, just Wainwright's eighth walk of the season, and Lucas Duda flied out to John Jay a step in front of the fence in right-center. Jay also made a nice grab to catch a wind-blown drive by Jordany Valdespin leading off the sixth.
Byrd singled with one out in the seventh and advanced on Buck's grounder to give the Mets a runner past first for just the second time. Nieuwenhuis, in an 0-for-19 slide, was intentionally walked to bring up Harvey's spot in the batting order, and pinch-hitter Justin Turner grounded out on a slow roller to third baseman Daniel Descalso.
Kozma, who had three hits, doubled with one out in the fifth when he popped the ball into short center. Nieuwenhuis sprinted in and tried for a sliding catch, but cut short his slide when Valdespin ran out from second and peeled off late just in front of him. Harvey then induced consecutive groundouts.
NOTES: The Mets started the same lineup and batting order from Nos. 1-8 in three straight games for the first time since April 23-26, 2011, STATS said.
Link to box score: St. Louis 2 at New York 1
Link to game discussion at The Cardinal Nation message board