Freshman Maverick Rowan added a season-best 17 points and Caleb Martin had 11 for the Wolfpack (4-2). They shot 47 percent and pulled away down the stretch for their second-straight win.
Barber was 19 of 22 from the free-throw line in surpassing his previous high of 34 points set against Pittsburgh last March.
He scored 10 points in the final 3½ minutes to give the Wolfpack just enough of a cushion against the Eagles, who never got closer than four points in the final few minutes.
Jimmy Gavin scored 38 points — the most in his brief Division I career — on 10 of 15 shooting with seven 3-pointers for Winthrop (4-1).
Keon Johnson's free throw with 53.2 seconds left made it 83-79. Barber followed with two free throws, Johnson missed a jumper with 30 seconds to play, and Barber hit two more foul shots with 25.1 seconds left that effectively iced it.
Lennard Freeman had 11 rebounds for N.C. State, which was coming off a victory over LSU in the third-place game at the Legends Classic in Brooklyn, New York.
Johnson finished with 15 points while Xavier Cooks and Bjorn Broman each had 10 for Winthrop, which was denied its second win over an Atlantic Coast Conference team in two years.
And before Barber got hot down the stretch, the building was buzzing about Gavin.
The 23-year-old graduate transfer, who spent the past two seasons at Division II Wisconsin-Parkside, put on a show by single-handedly keeping Winthrop in position for the upset.
He hit his first four shots of the half, including 3s on back-to-back possessions that gave the Eagles their largest lead. Joshua Davenport flipped the ball back to Gavin as the trailer, and he buried his sixth 3 of the night to put Winthrop up 55-51 with 15 minutes left.
Then, after the Eagles fell behind by 12, he reeled off a personal 8-0 run that made it 70-66 with 6 and a half minutes to play.