The loss brought the Cubs' season to an end.
The Cubs lost 3-1 to the Milwaukee Brewers Monday in a tiebreaker game to decide the winner of the National League Central Division. The Rockies also lost a division tiebreaker to the Los Angeles Dodgers on Monday.
Colorado left-hander Kyle Freeland pitched four-hit ball over 6 2/3 scoreless innings on short rest in his playoff debut. Nolan Arenado had a sacrifice fly in the first against Jon Lester, who gave up four hits in six innings.
Cole Hamels, normally a starter, threw two shutout innings of relief for Chicago. Kyle Hendricks, also a starter, got the final two outs in the top of the 12th.
It's the third time a wild-card game has gone to extra innings, and the home team won the previous two. Kansas City beat Oakland in 12 innings in the 2014 AL wild-card game, and Toronto defeated Baltimore in 11 innings to take the 2016 AL wild-card game.
Baez walked leading off the 11th against Seunghwan Oh and moved up on a sacrifice bunt by Albert Almora. Daniel Murphy was intentionally walked and Baez got tagged out by Arenado on Willson Contreras' grounder to third.
As Arenado applied the tag in the middle of the basepath between second and third, Baez wrapped his arms around him. Arenado smiled and patted him rather than try a throw to first.
Chris Rusin then retired pinch-hitter Victor Caratini on a grounder to first to end the inning.
Chicago had chances to score in the sixth and seventh.
Ian Happ, batting for Lester, walked leading off the sixth. With one out, right fielder David Dahl overran Kris Bryant's pop fly near the line, allowing the ball to drop for a single. That put runners on first and second, but just when it looked as though the Cubs were ready to break through, Anthony Rizzo grounded into an inning-ending double play.
Chicago loaded the bases in the seventh, helped by a wild pitch and catcher's interference, before pinch-hitter Jason Heyward struck out.
Rockies shortstop Trevor Story made a diving grab of Daniel Murphy's line drive for the second out of the inning.
The Cubs finally broke through in the eighth after Rizzo singled with two outs. Pinch-runner Terrance Gore stole second before Baez hit a line drive to left-center on an 0-2 pitch from Ottavino.
FANS OPTIMISTIC BEFORE GAME
Fans were optimistic that the Cubs could beat the Rockies. Meanwhile, the Cubs counted on fans to come out in full force and root for the home team.
"There are not many teams that can say this is their fourth post season appearance. Still a lot of excitement, a lot of energy," said Cubs Spokesperson Julian Green.
Of course, Rockies fans hope things go their way. Chace Foster and Weston Haynes flew in Tuesday afternoon from Alaska and came straight to the ball park. It's their first trip to Chicago and they hope to go home with bragging rights.
"Hundred percent. They got it. We hope. We hope for our sake," said Foster.
Tickets go on sale at noon. For more information, visit www.cubs.com/singlegametickets.
The Cubs have set their 25 man roster for the playoff game, going with 11 pitchers and 14 positions players.
WATCH: Playoff Ball: A Postseason Primer
The Cubs and Rockies played each other six times in the regular season with each team winning three games.
The Associated Press contributed to this report.