Jimmy Neesham and Colin de Grandhomme came to unbeaten New Zealand's rescue overnight with a 132-run partnership for the sixth wicket to lift the 2015 World Cup finalist's total to 237-6 against Pakistan.
Left-arm seamer Shaheen Afridi (3-28) had helped reduce the Black Caps to 46-4 and 83-5, when Kane Williamson was out for 41.
Neesham finished on his highest ODI score, 97 not out from 112 balls. He hit five fours and three sixes, including smashing a six off the last ball of the innings.
De Grandhomme was run out, too slow against Mohammad Amir's throw while going for a second run, to finish on a 71-ball 64.
Neesham and de Grandhomme hit Mohammad Amir for 18 in the 47th over, Neesham swinging for a six and his partner hitting two boundaries.
New Zealand narrowly chased down South Africa's 241-6 on the same Edgbaston wicket and this score, while it appears to be a sub-par total, could prove a nervy pursuit for seventh-place Pakistan in a must-win game.
New Zealand would advance to the last four with a win.
Spinner Mohammad Hafeez opened the bowling for Pakistan on a wicket offering turn, combining with left-arm quick Amir.
With the crowd chanting support, Amir bowled Martin Guptill for a golden duck in the first ball of his over with the batsman dragging the ball back onto his stumps.
Williamson, who won the toss and chose to bat first, sensibly let Amir's next delivery zoom past his off stump and went on to stabilize the innings before being caught behind against Shadab Khan in one of three catches for Pakistan captain Sarfaraz Ahmed.
An intensely partisan crowd — green Pakistan flags, green wigs, green jerseys and green Mexican waves — cheered Shadab's direct hit on the stumps as de Grandhomme scrambled through in the 30th over and cheered even louder when watching the screen replay.
They booed the not out review decision — a key decision with New Zealand still in double figures — but were back to cheering when Wahab Riaz directed a bouncer against de Grandhomme.