New Zealand resumed batting at 56-1. Spinner Yasir Shah bowled out skipper Kane Williamson for 37. Hasan, who had Tom Latham out yesterday, removed Jeet Raval and Ross Taylor within the space of five deliveries to take the match closer to a low-scoring thriller.
Boult´s 4-54 earlier derailed the Pakistani batsmen who were bowled out for 227 in response to New Zealand´s first innings total of 153.
He was well supported by debutant spinner Ajaz Patel (2-64) and Colin de Grandhomme (2-30) as Pakistan managed a first innings lead of just 74.
New Zealand then battled to 56-1 when bad light forced umpires to end the day with 4.2 overs still remaining on Saturday.
New Zealand can take heart from the fact that Pakistan lost a Test at this venue last year against Sri Lanka by 21 runs, falling short of a target of just 136.
Pakistan squandered a good chance of taking a big lead through some inept batting, with only Babar Azam (62), Asad Shafiq (43) and Haris Sohail (38) making significant contributions.
Azam hit five boundaries in his 109-ball knock and was the last man out when he edged Boult for wicketkeeper BJ Watling to take a low diving catch.
Pakistan had resumed at 59-2 but lost overnight batsmen Sohail and Azhar Ali (22) in the space of just six balls at the same score of 91.
Sohail was the more confident of the pair who added 64 for the third wicket. He hit four boundaries but was caught at short mid-wicket by Latham after a loose shot off leg-spinner Ish Sodhi´s low full toss.
Azhar was dropped by Jeet Raval off Boult on 19 and was again lucky two runs later when given not out as the fast bowler reviewed for a leg-before decision.
But Boult had the last laugh, forcing an edge off Azhar´s bat for Watling´s one-handed diving catch.
In spite of losing those two wickets during the morning session, Pakistan were well-placed at 144-4 at lunch, seeking a big lead to get a 1-0 advantage in the three-match series.
But Boult checked their progress by dismissing Asad Shafiq for 43, bowled off an inside edge. That was 174-5, the start of a passage that saw Pakistan´s last six wickets fall for 63 runs.
Patel had Sarfraz Ahmed caught off a miscued sweep for two and Bilal Asif stumped by Watling for 11 while Boult, de Grandhomme and Neil Wagner also chipped in.
Wagner, playing in his 37th Test, achieved a personal milestone by becoming the eighth New Zealand bowler to take 150 wickets when he dismissed Yasir Shah for nine.
Richard Hadlee leads the chart of New Zealand bowlers with 431 wickets in 86 Tests.
Others who have 150 or more wickets are Daniel Vettori (361 in 112 Tests), Chris Martin (233 in 71), Tim Southee (220 in 60), Boult (219 in 55), Chris Cairns (218 in 62) and Danny Morrison (160 in 48).
The second Test will be played in Dubai (November 24-28) and the third in Abu Dhabi (December 3-7).