Williamson missed out on a 19th Test century but Watling was unbeaten on 42 as New Zealand closed on 229/7, a measured recovery after being reduced to 72/4 by a triple strike from Yasir in the first session.
Yasir began his 33rd Test needing five wickets to become the fastest man to reach the milestone of 200 Test wickets. The record is currently 36 Tests, set 82 years ago by Australian legspinner Clarrie Grimmett.
Yasir managed 3/62 but was then thwarted by the fifth wicket stand of 104 in 249 balls between Williamson and Watling.
He failed to take any more wickets in the last two sessions and still needs another two wickets to hit the 200-mark and claim the record.
Williamson struck seven boundaries but these were the bright points in a day when defence came first.
The normally robust and aggressive Kiwi captain curbed his attacking instinct as he attmpted to carve out a first innings that might give his side some leverage in the match. The scoring rarely got above two an over.
Watling also dug in and the pair batted right through the middle session.
Williamson passed 50 in a Test for the 46th time but he was not able to convert his innings into another hundred. Having reached 89 off 176 balls, he mistimed a clip off Hasan Ali shortly after tea and found a gleeful Asad Shafiq oouching the catch at short midwicket.
Off-spinner Bilal Asif took over from Yasir, claiming Colin de Grandhomme for 20 and Tim Southee for two to finish with 2/57.
But Watling kept one end intact through his patient near-four hour batting, hitting only one boundary in his 180-ball display of self-denial.
With both teams needing a win to seal a series which is currently tied at 1-1, Yasir was the key and the leg-spinner induced a mini-collapse in the morning as the Kiwis slipped from 70/1 to 73/4 at lunch.
Yasir trapped opener Jeet Raval leg before with a faster one for 45. Raval reviewed but ball-tracking showed it would have hit leg stump.
With his next ball, Yasir clean-bowled Ross Taylor as the batsman went back but completely missed the ball.
Henry Nicholls saved the hat-trick but shortly after he attempted to sweep and Yasir flicking the ball as it went through to bowl him around his legs.
Yasir, whose 14 wickets helped Pakistan level the series in Dubai, has 25 wickets in the series so far.
It was teenage left-arm paceman Shaheen Shah Afridi, making his Test debut as a replacement for injured medium pacer Mohammad Abbas, who gave Pakistan their initial breakthrough and claim his first Test victim.
The 18-year-old nipped one back sharply to rap opener Tom Latham on the pads. Pakistan reviewed the on-field not out decision and were rewarded when ball-tracking showed the ball would have cannoned into the stumps.
New Zealand, who won the first Test by four runs in Abu Dhabi, brought in fast bowler Tim Southee and off-spinner Will Somerville in place of Neil Wagner and Ish Sodhi.
(With AFP inputs)
Inkakavala is your news, entertainment, music fashion website. We provide you with the latest breaking news and videos straight from the entertainment industry.