Baez hit an 0-1 slider from Alex Reyes (2-1) 417 feet onto the center field batter's eye for his 11th home run of the season. It was just the second earned run allowed by Reyes in 25 innings this season.
''I was sitting on the curveball a few times during Wainwright and I feel like they knew it, so I didn't get that pitch,'' Baez said, referring to Cardinals starter Adam Wainwright. ''The guy (Reyes) who throws the hardest is different.''
Craig Kimbrel (1-2) recorded the final four outs to improve Chicago's record to 4-4 in extra inning contests.
''Guys fought to the end,'' Cubs manager David Ross said. ''It's kind of been the character of this group, continuing to not give up, continuing having their at-bats, and good things happen.''
Wainwright did not earn a decision despite allowing just one hit and one walk with seven strikeouts in eight innings.
''He threw his heart out there for this team,'' Cardinals manager Mike Shildt said about Wainwright. ''It hurts him and it hurts everybody in the clubhouse. It was a hard-fought game that didn't go our way.''
Zach Davies had three strikeouts in five scoreless innings, allowing four hits and three walks. He was removed for a pinch hitter after throwing 75 pitches.
Nolan Arenado hit a sacrifice fly to lead off the bottom of the 10th on a night St. Louis went 0 for 10 with runners in scoring position.
Harrison Bader doubled on a grounder just inside the third-base bag and just out of third baseman David Bote's reach to lead off the fourth inning, but was doubled off second base on Justin Williams' soft liner to Nico Hoerner. Edmundo Sosa doubled, but was left at second after Lane Thomas walked and Wainwright struck out.
St. Louis loaded the bases with no outs in the seventh when pitcher Ryan Tepera threw wide to first base on Wainwright's bunt attempt. Tepera got Tommy Edman to ground into a fielder's choice, Paul Goldschmidt to pop out to catcher Willson Contreras and struck out Arenado on eight pitches to escape trouble.
''We've used him a lot, ridden him hard and gave him a couple days off,'' Ross said of Tepera. ''To come back out there and be as sharp as he was, that was really impressive and a really nice outing for him getting out of a jam there against some of the better hitters in the National League.''
''We had our chance, that's for sure,'' Shildt said. ''It's a big part of the game and we just weren't able to cash in in that inning or with people in scoring position.''
Ross was ejected by plate umpire Erich Bacchus for arguing balls and strikes in the top of the fourth after an 0-1 pitch to Kris Bryant was ruled a strike despite appearing to come in below his knees. It was Ross' third career ejection as a manager and second this season.
''You know, if you've got a guy who can execute pitches like Wainwright and you're giving him an extra couple inches on balls off the plate, it's going to be a tough night,'' Ross said. ''I saw that trend early on and felt like I needed to voice my opinion to try and get him on the plate.''
UPON FURTHER REVIEW
Chicago was unsuccessful in its challenge of pinch-hitter Nick Martini being ruled out at first base after grounding to second base to leadoff the sixth inning. First base umpire Tom Hallion's call was confirmed, dropping the Cubs to 7-6 on challenges this season.
LONG LASTING BATTERY
Wainwright and catcher Yadier Molina made their 282nd start as battery mates, tying former New York Yankees Red Ruffing and Bill Dickey for fifth-most all time in major league history.
Cubs: INF Matt Duffy remained out of the lineup after having been pulled from Saturday night's game with lower back tightness.
Cardinals: Placed RHP Miles Mikolas (right forearm tightness) on the 10-day injured list after was removed from his start Saturday night as he was warming up to start the fifth inning. RHP Junior Fernandez was recalled from Triple-A Memphis.
Cubs: RHP Jake Arrieta (4-4, 4.46) gets the start to open a three game series in Pittsburgh. The Pirates have not announced a starting pitcher.
Cardinals: Start LHP Kwang Hyun Kim (1-1, 2.73 ERA) in the opener of a three-game series at the Chicago White Sox. Former Cardinals manager Tony La Russa will start former Cardinals RHP Lance Lynn (4-1, 1.55 ERA) in his first game managing against his former team.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.