R.J. Davis scored a career-high 30 points for the Tar Heels (26-9), who blew a 67-42 lead following the ejection of Brady Manek. He had a season-high 26 before getting tossed with 10:08 to play.
Adam Flagler had 27 points for Baylor (27-7), who was trying to match the largest comeback in tournament history. James Akinjo had 20 points while Jeremy Sochan had 15 points and 11 rebounds.
Story of the game
North Carolina led 42-29 at halftime thanks to 17 points from Davis, who nailed four threes. A 15-4 run was powered by Manek, who scored 13 to push the lead to 67-42.
He was then ejected after being called for a flagrant two foul, throwing an elbow while trying to block out Sochan under the basket. That turned the tide in the Bears' favor.
Baylor reeled off 11 unanswered points, including back-to-back triples by Flagler, after a pair of free throws by Akinjo following a technical foul on Armando Bacot for tripping Sochan, it was a 67-53 game.
Cutting the deficit to nine with 4:14 to go on two free throws by Flagler, a three-pointer by Dale Bonner and a three-point play by Akinjo made it 76-73.
Bacot, who had 15 points and 16 rebounds, kept the Bears in the game by missing three free throws in the final 39 seconds.
Trailing 80-74, Sochan banked in a three before Akinjo sliced into the lane for a basket, drew a foul on Davis and completed the three-point play to tie it at 80-80 with 15.8 seconds remaining.
Davis had a chance to win it at the end of regulation, but his long three-point attempt was nowhere close.
Dontrez Styles canned a three to open the scoring in overtime and give the Tar Heels an 83-80 lead. Baylor center Flo Thamba fouled out with 3:47 remaining when he fouled Bacot, who hit one of two free throws.
Matthew Mayer came back after injuring his ankle near the end of regulation to hit a pair of free throws and Sochan scored on a putback to tie the score one final time at 84.
But Mayer fouled out and after Bacot hit a pair of free throws, he found Black for a basket before Davis completed a three-point play to stretch the North Carolina lead to 91-85 with 1:18 remaining.
The Tar Heels closed the game out and advanced to the Sweet 16 for a 35th time in program history.