Abdul-Malik Abu scored 19 for N.C. State (13-7, 4-3), which has now alternated wins and losses in each of its last 12 games.
A lob from Trevor Lacey to Abu for a dunk with two minutes left got the Wolfpack within 56-52, and Miami had to furiously hang on from there.
Ralston Turner made two 3-pointers in the final 1:33, both getting the Wolfpack within one, but his 3 that would have given N.C. State the lead with 40 seconds left hit the rim twice before bouncing away.
And with 5.3 seconds left, Barber was trying to get free for a 3-point try that could have tied it but he was called for pushing Miami's Davon Reed away.
When his teammates started connecting, it got contagious in a hurry.
Down by six at one point in the first half, the Wolfpack ripped off a 13-0 run over a four-minute stretch just before intermission and took a 33-26 lead into the locker room. Miami made its first three shots, then missed 17 of its next 22 over the rest of the half.
Not even 2 1/2 minutes into the second half, the N.C. State lead was gone. Miami opened the second half on a 12-2 run, going up 38-35 on a layup by McClellan to end that flurry -- and the Hurricanes wouldn't trail again.
McClellan and Rodriguez either scored or had the assist on Miami's first eight field goals of the second half.
N.C. State: The Wolfpack started 6-0 and are 7-7 since. ... Abu's season-high was 11 points; he eclipsed that in the game's first 7:40. ... From the this-is-tough-to-do department: The Wolfpack had seven more field goals than Miami in the first half (15-8) and only seven more points (33-26). ... It was the eighth straight game that N.C. State didn't get to the foul line more than its opponent. ... Wolfpack coach Mark Gottfried's career record fell to 361-200 overall.
Miami: The Hurricanes made their first two 2-point shots in the game's first 4:42, then missed their next nine -- not connecting again from inside the arc until the opening minute of the second half. ... The win was the 300th in conference play overall for Miami coach Jim Larranaga. ... Miami has now won consecutive home games for the first time since Nov. 28 and Dec. 2, having alternated wins and losses in their last seven games at the Bank United Center entering Thursday.
N.C. State: Host No. 8 Notre Dame on Sunday.
Miami: At Syracuse on Saturday