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
Mauer gives tearful thank you during retirement speech
Joe Mauer gives an emotional thank you to Terry Ryan for drafting him to the Twins back in 2001.
Joe Mauer officially bids Twins farewell in tear-filled news conference
Twins legend Joe Mauer formalized his goodbye to baseball on Monday at a tear-filled yet cheerful news conference to wrap up a 15-year major league career at age 35.
Ronald Acuna Jr. has flashed the talent to soon become NL's top player
While Shohei Ohtani and Ronald Acuna Jr. were named baseball's top rookies, the Braves outfielder has flashed the potential to quickly become one of the game's elite players.
Mariners deny ex-employee's claims of racism toward Latino players
The Mariners denied allegations made by a former employee that management called Latino players, especially those from the Dominican Republic, "dumb" and "stupid."
Braves' Ronald Acuna Jr. earns NL Rookie of the Year honors
Braves outfielder Ronald Acuña Jr. was named National League Rookie of the Year on Monday following a season that saw him hit .293 with 26 home runs and 64 RBIs in 111 games.
Angels' Shohei Ohtani beats Yankees' duo to win AL Rookie of the Year
Shohei Ohtani became the fourth Japanese-born player to win Rookie of the Year, as the Angels' two-way sensation beat out Yankees duo Miguel Andujar and Gleyber Torres for the American League award.