Lynn (8-6) combined with relievers Matt Bowman, Trevor Rosenthal and Tyler Lyons for the nine-hit shutout.
Lynn struck out three and walked none as he improved to 5-1 within the National League Central. He has held opponents to two earned runs or fewer in 13 of his 19 starts.
Tommy Pham was 3-for-4 with an RBI and a run scored for St. Louis, which scored one run in the fourth and three in the fifth.
The Cardinals (44-46), third in the NL Central, kept the Pirates (43-48) from leapfrogging them. Pittsburgh had won three in a row and six of seven.
Pirates starter Jameson Taillon (5-3) gave up four runs and eight hits in five innings, with five strikeouts and no walks. He was pitching for the first time since July 4, thanks to the All-Star break and being a late scratch from his scheduled start Sunday against the Cubs in Chicago because of food poisoning.
Taillon had not surrendered a run in his previous two starts, and St. Louis' first run, in the fourth, ended a career-high streak of 18 2/3 scoreless innings.
Pham doubled to lead off the fourth, moved to third on a grounder and scored on Jedd Gyorko's single to left for a 1-0 St. Louis lead. The threat ended when right fielder Gregory Polanco doubled Gyorko off first on Yadier Molina's line drive.
In the fifth, Luke Voit led off with a base hit to left. Taillon struck out the next two batters before Lynn doubled to center, where Andrew McCutchen bobbled the ball, allowing Voit to score and make it 2-0.
Lynn came home on Matt Carpenter's soft single up the middle. Carpenter stole second and scored on Pham's double to left for a 4-0 lead.
NOTES: St. Louis RF Stephen Piscotty (right groin strain) was put on the 10-day disabled list. ... The Cardinals recalled OF Magneuris Sierra from Double-A Springfield. ... St. Louis sat 2B Kolten Wong, moved 1B Matt Carpenter to second base and gave IF Luke Voit a start at first base. ... Pittsburgh stuck with the same lineup from Friday night.