New Zealand took the score on to 61 before Stokes, who on Sunday scored the fastest Test century at Lord's, off just 85 balls, struck twice in two balls.
Kane Williamson, who made 132 in the first innings, fell for 27 when he guided Stokes to Joe Root in the gully.
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.
But Corey Anderson survived the hat-trick delivery, allowing the ball to pass his stumps.
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.
Soon after tea, James Anderson nearly had his 400th Test wicket when Watling, on 40, was given out caught behind down the legside only for the batsman to overturn Indian umpire S Ravi's decision on review.
But Watling had to go when he gloved debutant fast bowler Mark Wood through to wicket-keeper Jos Buttler.
England then saw the back of dangerman Corey Anderson, lbw to part-time off-spinner Root, with Ravi's initial decision of 'out' seeing the tightest of 'umpire's call' verdicts fall in their favour when the batsman reviewed.
New Zealand lost their next two wickets on 198 but, with the draw now their only realistic goal, last man Trent Boult somehow managed to get out playing an attacking upper-cut off Broad, with Moeen Ali taking a fine catch running back at third man.
Earlier, England were dismissed for 478 after resuming on 429 for six.
England captain Alastair Cook took his overnight 153 not out to 162.
His marathon innings came to an end when he was caught behind off Boult.
Cook batted for more than nine hours, facing 345 balls including 17 fours.
His exit was the start of a Boult burst that saw the left-arm paceman take four wickets for nine runs in 17 balls for final innings figures of five for 85.