Yasir's strike left New Zealand fighting to save both the match in Abu Dhabi, and the series - now tied at 1-1 - as they reached 112-4 at lunch on the fourth day.
Pakistan's spinner Yasir Shah became the fastest bowler to take 200 Test wickets after dismissing William Somerville during the fourth day of the ongoing third Test against New Zealand at the Sheikh Zayed Stadium, Abu Dhabi on Thursday.
The two have added 52 runs for the fifth wicket but Nicholls was lucky to overturn a leg-before decision off Yasir on nine, and survived two other appeals.
The right-armer broke pre-World War record set by Australian Clarrie Grimmett in 1936 by requiring only 33 Tests to reach the landmark.
However, Pakistan's three dropped catches, two of them comparatively hard, would hurt them if New Zealand go on to draw the Test and walk away with a drawn three-match series.
His 14 for 184 were the second best match figures in a Test for Pakistan, behind former captain and current prime minister of Pakistan Imran Khan, who bagged 14 for 116 against Sri Lanka in Lahore in 1982.
Pakistani spinner Yasir Shah (C) holds the ball as he celebrates with teammates after breaking fastest 200 wickets record during the fourth day of the third and final Test cricket match between Pakistan and New Zealand at the Sheikh Zayed International Cricket Stadium in Abu Dhabi on 6 December, 2018.
The 32-year-old Shah took seven wickets in his 2014 debut Test against Australia in Dubai.
Skipper Kane Williamson was batting on a pugnacious 55 for his 29th fifty - and second in the match 1 and with him Henry Nicholls unbeaten on a chancy 20, as New Zealand led by 36 runs with six wickets intact. He took 21 and 25 wickets respectively in series wins over the West Indies.
As well as being the quickest bowler to 200 wickets, Yasir was the joint-second fastest to 100 Test wickets and the fastest Pakistani to 50 wickets.