New Zealand claimed a 40-run victory over India in the first Test after an enthralling finish in Auckland on Sunday.

With the Test in the balance as the tourists resumed at 87 for one on day four, the Black Caps eventually bowled India out for 366 in the final session.

Shikhar Dhawan (115), Virat Kohli (67) and Mahendra Singh Dhoni (39 off 41) had threatened to give India their first win away from home in the five-day format since June 2011.

But Neil Wagner (four for 62), Tim Southee (three for 81) and Trent Boult (three for 86) combined, leading the hosts to a 1-0 lead in the two-match series.

The New Zealand captain, Brendon McCullum, was named man of the match for his 224 in the first innings, while Wagner took eight wickets in the match.

Needing 407 to win, if India had made the runs it would have been the third highest successful run-chase in Test history. Cheteshwar Pujara (23) fell early on day four, edging a Southee delivery through to BJ Watling for the second of his six second-innings catches.

Kohli and Dhawan looked to be taking the game away from New Zealand as they built a 126-run partnership for the third wicket.

The hosts were largely unthreatening but got the break they needed during the middle session as Kohli tried to pull a Wagner delivery and was caught down low by Watling.

Despite the wicket, India still appeared to be on track for an unlikely triumph, having trailed by 301 runs after the first innings. That was until another wicket came largely out of nowhere as a Wagner bouncer caught Dhawan’s glove and flew through to Watling.

The arrival of the new ball also brought a wicket as Ajinkya Rahane (18) was given out lbw to Boult despite appearing to hit the delivery. It was the first ball after tea that really got New Zealand rolling as Rohit Sharma (19) edged a swinging Southee delivery to leave India 270 for six.

An aggressive Ravindra Jadeja smashed 26 off 21 before miscuing one from Boult which landed with Ish Sodhi at mid-on and reduced his side to 324 for seven. When Zaheer Khan (17) fell, India were 349 for eight before the big wicket of Dhoni all but ended the contest in controversial fashion. The India captain played a short Wagner ball onto his stumps but was told to wait as umpires checked for a no-ball. Wagner’s back foot appeared to be touching the side crease at one point, but Dhoni was given out.

Just three balls later and the Test was over as Ishant Sharma (four) edged Boult through to Watling.