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
Mets lose McNeil, struggling Cano to injured list
Robinson Cano, who is hitting .241 with 13 RBIs, has a quad strain, and Mets teammate Jeff McNeil, who is third in the NL with a .333 batting average, has a hamstring strain.
Christian Yelich and reimagining the 'five-tool player' in 2019
He's one of the five best players in baseball. But the Brewers star isn't actually a "five-tool player." Here's how that term is misunderstood -- and why it could use a refresh.
Prospects ready to help their teams win now
Phenoms such as the Braves' Austin Riley are getting the call to help contenders keep pace. Here's what to expect from them.
Indians look to turn around homestand vs. Rays
The Cleveland Indians saw their offense go missing the past three days as they were swept in a home series for the first time in nearly two years.
Power-infused Braves look for series win over Giants
Austin Riley appears to be skipping the learning curve that often comes with a rookie's first taste of major league pitching.
Angels, Twins try again after rare Anaheim rainout
The scheduled Wednesday night game between the Los Angeles Angels and Minnesota Twins that was postponed because of wet field conditions will be made up Thursday afternoon in Anaheim, Calif.