Milano Koenders scored the match-winner 1, on Sunday at Rat Verlegh Stadion.
Anthony Lurling handed NAC a surprise lead after 31 minutes, but Brett Holman leveled before halftime for AZ. The match remained level at 1-1 until the last minute, when Koenders converted from 8 yards.
NAC snapped a two-game losing streak and a four-game winless streak, and moved to 10th in the standings. AZ, which has just three losses this season, fell to its second defeat in its last four matches.
AZ's lead atop the standings closed to one point over PSV Eindhoven, which won 5-1 over Heerenveen for its sixth win in its last seven matches.
Ola Toivonen scored twice inside 24 minutes around a Tim Matavz goal, and Ajax added two more in the second half to open a five-goal cushion.
John Guidetti scored a hat trick as Feyenoord won for the fourth time during a five-match undefeated streak to climb to fifth with a 3-2 win over third-place Twente. Guidetti has 11 goals this season.
Ajax won its fourth straight as Miralem Sulejmani capped a 4-0 win over 10-man Den Haag with his 11th goal of the season. Christian Eriksen, Theo Janssen and Dmitry Bulykin also scored for Ajax, which is fourth.