The 32-year-old grabbed 8-41 in 12.3 overs which annihilated New Zealand to 90 all out in just 35.3 overs before taking two more wickets as New Zealand -- following on -- were 131-2 at close in their second innings.
Yasir dismissed opener Jeet Raval for two before accounting for New Zealand skipper Kane Williamson caught behind for 30 to complete his third ten-wicket haul in the match.
Tom Latham (44) and Ross Taylor (49) were at the crease at close as New Zealand need another 197 runs to avoid an innings defeat while Pakistan can level the series by taking another eight wickets with two days to play.
New Zealand won the first Test in Abu Dhabi by four runs last week to gain a 1-0 lead in the three-match series.
Taylor has hit six boundaries and a six in his return-to-form innings while Latham has hit three boundaries as the two have added 65 for the unbroken third wicket stand to take the fight to the Pakistan bowlers.
But the day belonged to Yasir who rocked New Zealand in the first innings.
Rain had delayed the start of the third day by an hour but when the action started Yasir was lightening, bowling to his best ability on a turning Dubai stadium pitch.
Yasir dismissed Latham (22), Taylor (nought) and Henry Nicholls (nought) in his ninth over, triggering a collapse during which New Zealand lost all their ten wickets for just 40 runs after being well set on 50 without loss.
Yasir's bowling figures -- his 15th five-wicket haul -- beat his previous best of 7-76 against Sri Lanka at Galle in 2015 and also the best against New Zealand.
Intikhab Alam (7-52) held the record for Pakistan's best bowling against New Zealand, achieved at Dunedin in 1973.
New Zealand, resuming at 27 without loss, lost Raval in an unfortunate way as he tried to reverse sweep Yasir but the ball deflected off his bat to his thigh and hit the stumps.
Raval top-scored with 31.
From 50-1 it became 61-2 when Yasir had Latham caught at short-leg by Imam-ul-Haq off the first ball of his ninth over.
Two balls later he bowled experienced Taylor with a beautiful delivery that turned and beat the forward push by the batsman.
Off his fifth ball Yasir bowled Nicholls through the gap between bat and pad.
It was Yasir who ran Bradley-John Watling run out soon after lunch for one before dismissing Ish Sodhi, Neil Wagner, Ajaz Patel and Trent Boult -- all without scoring in the space of nine balls.
Six New Zealand batsmen fell without scoring, making it the fifth occasion in a Test when six batsmen failed to score in an innings.
Williamson remained unbeaten on 28, watching wickets fell like nine pins at the other end.
With Sodhi's wicket Yasir also completed 100 wickets in 16 Tests in United Arab Emirates (Dubai, Sharja and Abu Dhabi).
The third Test will be played in Abu Dhabi from December 3.
First Published: November 26, 2018, 7:38 PM IST