The Kiwis had only been chasing 139 to win their Group A opener but were reduced to 49 for four and then 80 for six as the brilliant Lasith Malinga (four for 34) and Shaminda Eranga (two for 45) got among the wickets.
However, skipper Brendon McCullum and his brother Nathan made important contributions before Tim Southee (13 not out) and last man Mitchell McClenaghan (one not out) got them home by the skin of their teeth. Earlier Kumar Sangakkara's defiant 68 was the only plus point for Sri Lanka as they were skittled out for 138 inside 38 overs.
Despite losing opener Luke Ronchi (seven) early, New Zealand looked to be steadily working their way to victory until a run of three wickets in eight balls gave Sri Lanka hope. With the score on 48, Kane Williamson (16) misjudged a slow full toss from Malinga which hit him on the thigh bang in front, and the batsman unwisely reviewed despite being plumb.
Ross Taylor went without scoring to the last ball of the following over, lbw to Rangana Herath, before Martin Guptill (25), who had looked in good touch, edged Shaminda Eranga to Kumar Sangakkara to make it 49 for four.
The Black Caps looked in danger of collapse, and skipper McCullum (18) and James Franklin (six) tried their best to steady the ship.
They got the score to 70 before Franklin fell lbw to Tillakaratne Dilshan with 69 still needed. Daniel Vettori (five), clearly being hampered by his longstanding Achilles problem, did not last long on his return to the side as he got a very poor decision.
He was given out lbw to Malinga despite getting a clear inside edge onto his pad, but with no review to utilise he had to go. Nathan McCullum (32) and his brother slowly chipped away at the target, but two full Malinga deliveries did for them to put the game back in the melting pot at 122 for eight.
Southee survived an appeal despite being plumb lbw to Malinga, before Mills (three) was run out as Thisara Perera missed the stumps at the bowler's end but saw his wayward effort hit the wickets at the other end.
However, New Zealand just managed to reach their target - with a suitably chaotic end as McClenaghan dived to make his ground for a second run, Sangakkara fumbled as he broke the stumps and an eventual wide signal made the run-out attempt immaterial.