Wilson's 26-yard keeper set up Andre Brown's short TD run in a 21-point third quarter for N.C. State (5-6, 3-4 Atlantic Coast Conference).
The Wolfpack kept their bowl hopes alive with a second win in a row in the rivalry.
Wilson had a career-high 279 yards passing. Jamelle Eugene ran for two scores for N.C. State.
The Tar Heels (7-4, 3-4), who had a shot to win the Coastal Division before the loss, committed six turnovers.
BOSTON COLLEGE 24, WAKE FOREST 21
In Winston-Salem, N.C., backup quarterback Dominique Davis sneaked 1 yard for a touchdown with 1:12 remaining to lead Boston College past Wake Forest and keep the Eagles' Atlantic Coast Conference title hopes alive.
Davis, who took over for the injured Chris Crane in the second quarter, was 13-for-23 for 103 yards, and two of his fumbles were returned for touchdowns.
But he led his team on the decisive nine-play, 70-yard drive in the final 5 minutes to help the Eagles (8-3, 4-3) win in Winston-Salem for the first time. The win sets up a winner-take-all matchup next week with Maryland for the Atlantic Division title.
VIRGINIA TECH 14, DUKE 3
In Blacksburg, Va., Sean Glennon threw for a touchdown and Macho Harris returned an interception for another as Virginia Tech defeated Duke.
A win over Virginia next week would clinch the Coastal Division title for the Hokies (7-4, 4-3).
With 38 seconds left before halftime, Jarrett Boykin hauled in the first touchdown catch of the season by a Hokie wide receiver.
Harris intercepted two passes, returning the second 23 yards for a score with 1:23 left in the game.