It took the Tar Heels (24-9) nearly eight minutes to get their first bucket of the game. A frustrated Roy Williams subbed out the entire lineup and it seemed to energize UNC.
North Carolina caught a huge break at the end of the first half - a very dubious foul call against the Hurricanes on Cameron Johnson's 60-foot heave that sailed over the backboard gave the Heels three free-throws with virtually no time left. Johnson sank them all to give the Heels a 32-31 lead at the break.
Theo Pinson scored 25 points and made a monster dunk late in the game that seemed the take the life out of the No. 3 seed Canes. He also grabbed 11 rebounds. Johnson finished with 13 points.
UNC won despite having Luke Maye record one of his worst performances as a Tar Heel, shooting just 1 for 15 from the floor and finishing with just two points. Maybe came in averaging more than 17 points per game.
Point guard Joel Berry II shot 4 for 14, playing through a twisted ankle.
UNC and Duke will meet in the ACC Tournament semifinals for the second consecutive year - just as the rivals did last year in the tournament's debut at Barclays Center. It will be the 22nd time Duke and North Carolina play in the ACC Tournament. Duke leads 13-8 alltime.
Ja'Quan Newton, who beat North Carolina nine days ago in Chapel Hill with a 40-foot buzzer beater, scored 17 points for Miami (22-9).
North Carolina: The Tar Heels have been gritty and Pinson has been brilliant in pulling away from Syracuse and Miami here in Brooklyn. But they'll need to knock down more shots to deal with Duke. Other than Pinson, the Tar Heels were 20 for 59 from the field (34 percent).
Miami: Freshman Chris Lykes and Lonnie Walker IV have stepped up for Miami since Bruce Brown was injured 12 games ago. Against UNC, they shot a combined 7 for 25.
BAD START, FORTUNATE FINISH
North Carolina went almost 7 minutes without scoring to start the game, missing its first 13 shots and falling behind 14-0.
Tar Heels coach Roy Williams got so exasperated by his team he made a wholesale lineup change, all five starters out at once. The Duke fans who remained at Barclays after watching their team win the earlier game had a blast watching the Tar Heels struggle.
Backup point guard Seventh Woods snapped the drought for UNC with a three-point play at 12:51.
The Tar Heels then finished with a flourish and grabbed the halftime lead when Cameron Johnson was fouled by Walker while getting off a 60-foot heave to beat the first-half buzzer. Johnson made all three free throws to put the Heels up 32-31 heading to the locker room.
Miami's Anthony Lawrence played only 10 minutes of the first half after he appeared to tweak his ankle.
He returned for the second half and hit a couple early 3s. In a span of about 2 minutes of clock time early in the second, Berry and Johnson both left the game after getting banged up. Berry twisted his left ankle getting off a shot, went to the locker room and returned within minutes. He re-entered when Johnson left after 245-pound Ebuka Izundu of Miami made a leap to block a shot and landed on Johnson's back.
Soon after Berry landed an elbow to Izundu's face as he was scoring over the Miami big man and was called for a foul.
Johnson came back with what North Carolina called a hip injury.
North Carolina: The Tar Heels split with Duke this season, each winning at home. The Blue Devils won on Saturday 74-65.
Miami: The Hurricanes' next stop is the NCAA tournament