New Zealand beat Pakistan by 3 wickets