Tom Latham (44) and Ross Taylor (49) were at the limit, as New Zealand needed another 197 rounds to avoid a half-time defeat, while Pakistan could match the series, taking eight more gates days to play.
New Zealand won the first four rounds in Abu Dhabi last week to win a 1-0 lead in the three-game series.
Taylor hit six limits and six in halves, while Latham hit three limits, while the two added 65 for the third innocent pedestrian to fight bowlers in Pakistan.
But the day belonged to Yasir, which sparked New Zealand in the first rounds.
He also became the first Pakistani who took ten brands in a single day, the ninth in the world, with the British left-arm journal, Johnny Briggs, who did it twice.
"When I came to the field, I thought I had to win ten brands in the game, but I never thought it would come in one day," Yasir said.
"We came from an accident and did not get the necessary pace against Australia (last month), but now I get it and I am very happy to get it," Yasir said.
The rain delayed the start of the third day with an hour, but when the action began, Yasir shone, bowling to the best ability on a Dubai pitch.
Yasir rejected Latham (22), Taylor (nothing) and Henry Nicholls (nothing) in the ninth row, triggering a collapse in which New Zealand lost all ten gates for only 40 rounds after it was well established at no loss.
Yasir bowling footballers – the 15th-five-wicket competition – beat the 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 the best bowling in Pakistan against New Zealand, held in Dunedin in 1973.
New Zealand, resuming 27 years without loss, lost Raval in an unfortunate way, trying to reverse Yasir, but the ball deviated from the bat to his thigh and hit his fists.
Raval was scored with 31 points.
From 50-1 he became 61-2 when Yasir took Latham to the short leg of the Imam-Haq on the first ball of the ninth.
Two balls later he thrilled Taylor with a beautiful delivery who came back and beat the pushing before the batsman.
On the fifth ball, Yasir faced Nicholls through the gap between the bats and the buffer.
It was Yasir, who ran Bradley-John Watling shortly after lunch, before releasing Ish Sodhi, Neil Wagner, Ajaz Patel and Trent Boult, all without scoring in nine balls.
Six New Zealand batsmen fell without a score, making it the fifth time in a test when six batsmeni failed to score in a half.
Williamson remained unbeaten at the age of 28, looking at the ice falling as nine pins at the other end.
With Sodhi's shoe, Yasir also completed 100 wickets in 16 tests in the United Arab Emirates (Dubai, Sharjah and Abu Dhabi).
The third test will be played in Abu Dhabi on December 3rd.