New Zealand has beaten Sri Lanka by five runs in a sensational finale to their Twenty20 and drawn the series 1-1 in Dambulla.