Jonathan Broxton (1-4) took the loss. The Cardinals had a base open with one out in the eighth but elected to pitch to Zimmerman and see if he would expand his zone with two strikes.
"Zimmerman has issues this year with the right-handers, hitting under .200," manager Mike Matheny said. "It didn’t work this time."
Brandon Moss hit a 454-foot homer for St. Louis, which leads the Pirates by six games with 29 to play in the NL Central.
Kolten Wong had three hits for the Cardinals in their second loss in 11 games.
"Today, we just couldn’t pull it off," manager Mike Matheny said.
Moss ended Wednesday night’s game in the ninth with a three-run homer. He led the second against Scherzer with the longest home run by a left-hander at 10-year-old Busch Stadium and the fifth-longest overall.
The Nationals answered with homers by Werth in the third and drives by Zimmerman in the fourth and sixth.
Zimmerman has 16 homers in an injury-abbreviated season, four in this series.
The Cardinals opted to give 15-game winner Michael Wacha some rest and fill-in starter Tyler Lyons allowed three runs in six innings. Lyons struck out six the first time through the order.
Nationals manager Matt Williams used four pitchers to escape the seventh when the Cardinals tied it on Wong’s RBI single but stranded two.
"We’re trying to get to the eighth," Williams said. "We can’t run through the bullpen like this every night but we wanted to make sure we got one at least."
Scherzer bounced a slider on strike three to Stephen Piscotty and the ball got away with two outs and a man on second in the sixth. Catcher Wilson Ramos quickly recovered it and made a perfect throw to first that was just in time.
Nationals: Bryce Harper (left glute tightness) was removed before the bottom of the fourth after going 0 for 2. … Tanner Roark will replace Stephen Strasburg (back) in the rotation Friday against Atlanta. Strasburg is scheduled for a bullpen session Thursday and could pitch as soon as Saturday. … OF Michael Taylor (right knee soreness) was a late lineup scratch.
Cardinals: OF Jon Jay (wrist) is close to returning to a now-crowded outfield.
Nationals: Jordan Zimmermann (11-8, 3.45) has won his past three starts and faces the Braves at home.
Cardinals: Carlos Martinez (13-6, 2.91) faces the Pirates Friday to begin a weekend series with two extra days of rest. He’s 2-1 with a 4.35 ERA against Pittsburgh, much better than Lance Lynn, 0-2 and 6.94. Lynn (ankle) is getting extra time.