Matt Adams hit a two-run homer in the first and scored during St. Louis' five-run eighth inning, as the Cardinals topped the Milwaukee Brewers 7-2 at Miller Park.
The NL Central-leading Cardinals maintained a two-game advantage in the division standings while reducing their magic to number for clinching a playoff spot to one.
Lance Lynn (14-10) picked up his first win since Aug. 4 after limiting the Brewers to a run on four hits in 6 1/3 innings. Lynn, who was 0-5 in his previous eight outings, struck out seven and walked four.
"Once he found that groove, and you could tell found that four-seamer, it was a completely different game," Cardinals manager Mike Matheny said.
Adams' homer was one of four hits given up by Yovani Gallardo (11-10). The Milwaukee right-hander walked two and matched Lynn with seven punchouts in seven innings of work.
"He hits mistakes," Gallardo said of Adams' homer.
Khris Davis knocked in both runs for the Brewers. A groundout with the bases loaded halved Milwaukee's deficit in the first and he doubled home Jonathan Lucroy in the eighth.
St. Louis, though, had broken the game open in the top of the inning.
After retiring the leadoff batter, reliever Rob Wooten gave up three straight singles before issuing a bases-loaded walk to Yadier Molina. David Freese then plated a pair with a single, and Daniel Descalso greeted Alfredo Figaro with a two-run double.
Matt Carpenter hit his 54th double of the season in the fifth inning, breaking Stan Musial's single-season Cardinals record for the most doubles by a left- handed batter. Joe Medwick owns the overall single-season club mark with 64 doubles in 1936 ... Gallardo fell to 1-11 in 17 career starts against St. Louis.