With two outs and the game tied 2-2, the St. Louis outfielder drove a pitch from reliever Tyler Clippard over the left field wall to give the home team their second straight win against Washington.
"It was a terrible pitch," Clippard told reporters of Ludwick's blast. "Cutter, trying to go away and I threw a nice little cement mixer up there for him -- middle in -- and he hit it out."
Cardinals (23-17) starter Chris Carpenter improved to 5-1 after allowing two runs in eight innings and Ryan Franklin pitched the ninth for his ninth save of the season.
The Nationals (20-20) lost their season-high fifth straight game despite coming back from a two-run hole and tying the game in the eighth on Ian Desmond's RBI single.
The St. Louis right-hander also allowed a fifth-inning home run by Wil Nieves.
"I felt fine. I worked hard all night long," Carpenter said after throwing 118 pitches. "It had nothing to do with the hundred and whatever pitches I threw."
The Cardinals provided their pitcher a 2-0 advantage in the third when Felipe Lopez belted a two-run homer in his second game off the disabled list from an elbow injury.
(Reporting by Jahmal Corner in Los Angeles; Editing by Rex Gowar/Ian Ransom)