Lance Lynn knew from the first pitch on Thursday that his recent struggles were over for at least one game.
The St. Louis right-hander bounced back from a frustrating stretch to allow one run over seven innings and the Cardinals scored three times in the third inning of a 3-1 win over the Philadelphia Phillies.
Matt Carpenter, Jon Jay and Matt Adams drove in runs for the Cardinals, who have won seven of nine.
Philadelphia has lost five in a row, tying a season high. The Phillies also dropped five straight from June 7-12.
St. Louis, which swept the three-game set, has the most wins in the majors at 62 and is a season-high 25 games over .500.
Lynn (12-5) had dropped four of his previous five decisions and was 3-4 with a 6.32 ERA in his past eight starts.
"I knew I had to be a lot better than I had been," Lynn said. "It was bad."
Lynn came out against the Phillies with an aggressive mindset, which paid immediate dividends. He realized quickly that he had rediscovered his early season groove.
"I had good stuff early on and I could feel it," Lynn said. "I knew I had it from the get-go. I was able to attack with my fastball and able to get into a rhythm."
Lynn, who was 8-1 with a 2.76 ERA in his first 12 starts, gave up just five hits against the slumping Phillies, who have scored just nine runs during the five-game skid. He struck out six and walked four.
Lynn's turnaround came at a perfect time. St. Louis is set to embark on an 11-game road swing beginning Friday in Atlanta.
Lynn, whose last win came on July 7, retired eight batters in a row from the fourth through seventh innings. He set the side down in order in the fifth and sixth on a combined 23 pitches.
"That's what we've been hoping to see," St. Louis manager Mike Matheny said. "He kept his focus and he still maintained his energy. He had impressive depth to his sinker."
Closer Edward Mujica picked up his 30th save in 32 opportunities. He struck out two and is tied with Pittsburgh's Jason Grilli for the most saves in the NL. Trevor Rosenthal pitched a scoreless eighth for the Cardinals.
Mujica, who converted his first 21 save opportunities this season, needed to 14 pitches to nail down the victory.
"At the beginning of the season, they gave me the ball in the seventh inning," Mujica said. "I never thought about being a closer. This is unbelievable for me."
St. Louis scored three times on four hits off Philadelphia starter Kyle Kendrick (9-7) in the third.
Carpenter drove in Pete Kozma with a one-out single. Jay followed with an RBI triple and Adams added a run-scoring single.
St. Louis, which leads Pittsburgh by 2 1/2 games in the NL Central, won five of six games on its homestand.
"You show up every day wanting to play and you end up with good results," Carpenter said. "This was a big day for us."
Kendrick allowed three runs and five hits over six innings. He gave up just one hit in five of the innings, but the third inning was costly.
"One bad inning can lose a game for you," Kendrick said. "It was a quality start, but I had to pitch than that tonight and I didn't do it."
Erik Kratz drove in the Phillies' run with a single in the fourth.
Philadelphia outfielder Steve Susdorf grounded into a double play in the seventh in his major league debut. He was recalled earlier in the day to replace Domonic Brown, who was placed on the seven-day concussion disabled list.