The 25-year-old left-hander scored 85 off 109 balls and added 110 for the seventh wicket with veteran Shahid Afridi (who hit a 51-ball 61) to rescue Pakistan from a precarious 124-6 and turn it into a 1-0 lead in the five-match series.
Pakistan, set a daunting 247-run target, were struggling at 40-3 before Sohail added 34 with skipper Misbah-ul Haq (13) and 38 with Sarfraz Ahmed (26) to steady the innings.
Afridi hit seven boundaries and a six in his 37th one-day fifty.
Earlier, Ross Taylor became the sixth batsman, and first from his country, to score three hundreds in consecutive matches to lift New Zealand to 246-7.
More From This Section
Pakistan's Zaheer Abbas and Saeed Anwar, and South Africa's Herschelle Gibbs, AB de Villiers and Quinton de Kock have also achieved the feat.
Pakistan lost wickets at regular intervals with Mohammad Hafeez (six), Asad Shafiq (five), Ahmed Shehzad (28) and Younis Khan (four) trudging back to the pavilion with the score barely passing 50.
But Sohail and Afridi rescued Pakistan.
Misbah admitted it was a difficult match.
"It was very tough. Full marks to the way Sohail and Afridi batted and rescued us," he said.
New Zealand captain Kane Williamson felt his team didn't capitalise on Taylor's hundred.
"I think on the back of Ross's superb knock we had a reasonable total on the board but it's a shame we didn't do the job well with the ball and Pakistan's middle order came good," said Williamson.