At tea on the fifth and final day, New Zealand were 134 for five, needing a further 211 runs to reach their victory target of 345.
But, realistically, they now needed to bat through the final session to force a draw and prevent themselves going 1-0 down in this two-match series.
However, the gritty BJ Watling was 36 not out and the dashing Corey Anderson 51 not out, with their sixth-wicket stand so far worth 73.
Kane Williamson, who made 132 in the tourists' first innings, fell for 27 when he guided Stokes to Joe Root in the gully.
Also Read
And next ball New Zealand captain Brendon McCullum played on to a Stokes inswinger.
Given a roar by the crowd worthy of Ian Botham or Andrew Flintoff, Stokes, the New Zealand-born son of former Kiwi rugby league international Ged Stokes, who came to England as a 12-year-old, charged in again.
Anderson, in Stokes-like fashion, later pulled the Durham all-rounder for six.
Deciding attack was the best form of defence, Anderson completed a 44-ball fifty in which 46 of his runs -- 10 fours and a six -- came in boundaries.
New Zealand were rocked from the very start of their chase, losing both openers for ducks without a run on the board in a match where, for the most part, they had been on top.
The second ball of New Zealand's innings saw Martin Guptill caught in the slips by Gary Ballance off James Anderson.