Matt Carpenter homered in the 10th inning against Craig Kimbrel in the All-Star closer's return, and the St. Louis Cardinals regrouped after blowing a late lead to beat the Chicago Cubs 5-4 Thursday night at Wrigley Field.

Emerging ace Jack Flaherty shut down Chicago over eight innings, and despite a tying three-run rally in the ninth, the Cubs dropped a game behind Milwaukee for the second NL wild card and four games behind St. Louis for first place in the NL Central.

Cubs slugger Anthony Rizzo provided a jolt in his unexpected return from a sprained right ankle, homering in the third inning to tie the game at 1. But Flaherty was spectacular otherwise, pitching three-hit ball while allowing just the one run and striking out eight.

Carpenter homered to deep center field off Kimbrel (0-3), who was activated from the injured list before the game after dealing with right elbow inflammation.

Giovanny Gallegos pitched a perfect 10th for his first save in two chances. Andrew Miller (5-5) recorded the final two outs in the ninth for the victory.

Chicago fell to third place in the division for the first time since April 27.

Milwaukee 5, San Diego 1: Milwaukee pitchers struck out 16 batters and the host Brewers moved within one game of Washington for the top NL wild-card spot. Lorenzo Cain hit a solo home run before exiting the game with a sore left ankle. The Brewers are 7-2 since reigning NL MVP Christian Yelich broke his right kneecap on a foul ball. "We understand it's not going to be easy," Cain said.

Atlanta 5, Philadelphia 4: Ronald Acuna Jr. became the second-youngest player in baseball history to hit 40 homers in a season, and the host Braves clinched at least a tie for first place in the NL East with a victory over the Phillies. Mel Ott, who was 20 when he hit 42 homers for the New York Giants in 1940, is the only player younger than Acuna to post a 40-homer season. Eddie Mathews also was 21 but about two months older than Acuna when he hit 47 homers for the Milwaukee Braves in 1953.

Mattingly extension: The Miami Herald confirmed that the Miami Marlins have agreed to a contract extension with manager Don Mattingly. The terms of the deal have not yet been disclosed.

Associated Press