The 24-year-old struck 101 off 127 deliveries on difficult pitch conditions to chase down their target of 238 with five balls of their innings to spare.
Earlier, Shaheen Afridi starred with the ball to restrict New Zealand to 237-6 - with Jimmy Neesham (97) and Colin De Grandhomme (64) getting the Black Caps up to a respectable score.
Their victory heaps more misery on the hosts, who must now win both games against India and New Zealand to secure their semi final spot.
Shaheen shines but Kiwi all-rounders lead fightback
After a delayed start, Kane Williamson elected to bat first in overcast conditions and his side were immediately under pressure when Martin Guptill (5) dragged on to his stumps off Mohammad Amir in the second over.
Williamson came to the crease looking to rebuild the Kiwis innings - as he had done throughout the World Cup - with Colin Munro, but the out of sorts opener soon found himself back in the pavilion after flashing at a wide Shaheen Afridi delivery.
It wasn't long before Afridi (3-28) struck again twice, taking the notable scalps of Ross Taylor (3) - courtesy of a marvellous catch by Sarfaraz Ahmed - and Tom Latham (1) to leave New Zealand 46-4 off just 13 overs.
The consistent Williamson edged his side away from a potential collapse and towards the hundred mark, but edged behind a wonderful delivery by leg-spinner Shadab Khan (1-43) for 41 to the joy of the Pakistani-dominated crowd.
New Zealand struggled to score with their usual aggression, but the all-rounder duo of Jimmy Neesham and Colin De Grandhomme plugged on and registered two conservative - yet impressive - fifties to guide them towards a respectable score.
The Black Caps needed an expensive over and they got their reward in the 47th over, with 18 runs coming off the bowling of Mohammad Amir to take their score past 200.
The Kiwis looked to salvage any bonus runs they could, but paid the price when De Grandhomme was run out looking for an unlikely second run for 64, and brought an end to his and Neesham's 132-run partnership.
But Neesham carried on to register a career-best 97 not out and took New Zealand up to a competitive 237/6 on a challenging wicket, adding further pressure onto Pakistan in the process.
Babar Azam leads perfectly paced Pakistan innings
Pakistan looked to get their innings off to a fast start, crashing three fours of Matt Henry's first over before Fakhar Zaman (9) spooned a Trent Boult delivery into the hands of Martin Guptill, with Imam Ul-Haq (19) following soon after off the bowling of Lockie Ferguson.
Babar Azam and Mohammad Hafeez's (32) 56-run partnership looked to be steering Pakistan to victory before the latter gifted his wicket to Willamson (1-39) when caught at long on by Ferguson.
However, Babar remain unfazed and soon brought up his fifty - and 3000 ODI runs in the process - before reaching his 10th ODI hundred.
Haris Sohail (68) needlessly ran himself out with two runs required, leaving Sarfaraz to hit the winning runs and keep his side in the hunt for a place in the semi finals.