Karl Cochran scored 14 points to lead Wofford, which shot just 36 percent but hung right with the Wolfpack (8-2) all afternoon before rallying from six down in the final 3½ minutes for the win.
Lacey finished with 18 points, including a jumper over Cochran for a 54-53 lead with 35.1 seconds left. N.C. State shot 42 percent, including just 7-for-22 (32 percent) after halftime.
N.C. State was in position to close this one out after Lacey's jumper pushed the lead to 52-46 with 3:27 left. But Cochran answered with a 3-pointer out of a timeout, then found Lee Skinner for a layup with 1:31 left that cut the deficit to 52-51.
Then, after a miss by Kyle Washington inside, Eric Garcia hit a straightaway jumper with 51.1 seconds left to give Wofford the lead.
Lacey came back once more to put the Wolfpack back in front before the frantic final minutes.
The game also marked the first time that referee Karl Hess has worked an N.C. State game in nearly three years. In his last appearance, Hess ejected former Wolfpack stars Tom Gugliotta and Chris Corchiani from their seats behind the scorer's table during a February 2012 game.
Hess heard plenty of boos each time he blew the whistle in this one, including when he called a technical foul on Wolfpack coach Mark Gottfried barely 4 minutes into the game to further irk the home crowd.