Resuming on 207-4, Sohail started on an unbeaten 81 and Babar Azam on 14. Sohail took 309 balls to score his second Test ton.
Azhar Ali who could not prevent a narrow defeat in the first test despite a defiant 65 in the second innings, put on 126 runs with Sohail for the third wicket to leave Pakistan in control on day one.
But his run-out in the 71st oversaw the New Zealanders spring to life and spinner Ajaz Patel, the hero of the first test with a match haul of seven wickets, then sent back Asad Shafiq for 12.
Sohail, who smashed 10 boundaries in his 240-ball knock, helped Pakistan to see off the second new ball and guided them to the close of play without any further hiccups.
Pakistan found themselves in a spot of bother at 25-2 within the first 10 overs after skipper Sarfraz Ahmed had won the toss and elected to bat first.
Azhar hit seven boundaries and sent one over the fence as he combined with Sohail to grind out the Kiwi bowling, but perished in a mix-up as he approached what would have been a well-deserved century.
New Zealand edged the first test in Abu Dhabi by four runs to take a 1-0 lead in the series. The teams return to the same venue for the final match from December 3 to 7.
Pakistan: Imam ul-Haq, Mohammad Hafeez, Azhar Ali, Haris Sohail, Asad Shafiq, Babar Azam, Sarfraz Ahmed (captain and wicketkeeper), Bilal Asif, Yasir Shah, Hassan Ali, Mohammad Abbas
New Zealand: Jeet Raval, Tom Latham, Kane Williamson (captain), Ross Taylor, Henry Nicholls, BJ Watling (wicketkeeper), Colin de Grandhomme. Ish Sodhi, Neil Wagner, Ajaz Patel, Trent Boult