ST. LOUIS -- Jhoulys Chacin had some extra motivation.
"I can die now," Chacin joked to reporters.
Milwaukee (69-57) snapped a three-game losing streak and moved back ahead of St. Louis (68-57) for the second National League wild card. The Cardinals lost for just the second time in their last 12 games.
"We talk about racking up wins and banking wins and we banked a win today and got a great pitching performance," Brewers manager Craig Counsell said. "I thought we swung the bats pretty good. It's a good win. That's a team that's right in the thick of things and going to be there for the rest of the year."
Chacin (13-4) entered the game 0-7 with a 6.90 ERA in nine career games, including eight starts, against the Cardinals, but shut them out through six innings as the Brewers avoided their first three-game sweep at St. Louis since July 1-3, 2016.
"This might be the biggest game of the season for me," Chacin said. "The Cardinals have always been tough on me and this year it was an obsession."
Chacin has won his last three starts and has given up three runs in his last 19 innings. The Brewers improved to 19-8 in his starts this season.
"I thought he kept them off balance, his slider was again good and his fastball," Counsell said. "He threw fastballs and it was good sequencing."
Moustaskas hammered an 0-2 pitch down the first-base line to score Orlando Arcia and Lorenzo Cain, giving the Brewers a 2-0 lead in the third. Arcia and Cain each stole a base to help get them into scoring position ahead of Moustaskas.
"We always talk about little things and being able to vary our times and our holds and being quick to the plate is important, something that we've done really really well all year," Cardinals interim manager Mike Shildt said of Cain's steal. "The reality is the guy's an accomplished base stealer as well. It was a big play."
John Gant (5-5) gave up two runs on six hits and two walks in 4 1/3 innings. Gant has failed to make it past 4 1/3 innings in three of his last four starts.
"It was just one of those days," Gant said. "I never really found a good, solid groove."
Patrick Wisdom hit his first career home run 414 feet into the bleachers in left-center to lead off the eighth for St. Louis.
The Brewers had lost six of their last eight heading into the game.
"It was a really good day for me and for the team," Chacin said. "I think anything is possible for me and for the team. We win on Sunday, a day game and finally beat the Cardinals. It couldn't get better. From this day I hope we keep rolling."
Yadier Molina started his 27th straight game, a major league record for catchers 35 years or older.
Milwaukee: C Manny Pina (left shoulder) missed his third straight game and is day-to-day.
Cardinals: 2B Kolten Wong (bruised elbow) pinch hit and flew out after being taken out of Saturday night's game. RHP Carlos Martinez (right shoulder strain) and IF Yairo Munoz (right wrist sprain) were scheduled to play Sunday at Double-A Springfield and could join the team in Los Angeles.
Milwaukee: RHP Chase Anderson (7-7, 3.97 ERA) will start a three-game series against the visiting Cincinnati Reds and RHP Homer Bailey (1-10, 6.33 ERA) on Monday night. Anderson is 4-1 with a 2.98 ERA in nine career starts against the Reds.
Cardinals: LHP Austin Gomber (3-0, 2.89 ERA) will kick off a six-game road trip Monday night against the Los Angeles Dodgers and LHP Alex Wood (7-7, 3.51 ERA). Gomber has won his last two starts and has an 11-inning scoreless streak.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
Cubs shake up player-development operation
The Chicago Cubs shook up their player-development operation, with Matt Dorey taking over as senior vice president of player development and directors of pitching and hitting being appointed.
Astros manager AJ Hinch says talk of whistling to signal pitches a 'joke'
Astros manager AJ Hinch said speculation around his team, including whether they used whistles to signal pitch calls, is a joke.
AJ Hinch to pull Astros off field if Yankees fans throw objects
Astros manager AJ Hinch said Thursday he will remove his team from the field if fans at Yankee Stadium again throw objects at his players in Game 4.
Giancarlo Stanton remains out of Yankees' lineup with quad injury
Yankees outfielder Giancarlo Stanton, who is dealing with a quad injury, is not in the starting lineup for Game 4 of the ALCS.
Roberto Perez expected ready for camp after surgery
Indians catcher Roberto Perez had surgery to remove bone spurs in his right ankle.
What we've learned so far during the MLB playoffs -- and what might come next
From who will win it all to what's up with the baseball, Jeff Passan answers this October's 20 biggest questions.