* Wagner strikes at crucial moments
* Dhoni led final session fightback (Adds details, quotes)
AUCKLAND, Feb 9 (Reuters) - Neil Wagner captured four wickets at crucial times as New Zealand held off a counter-attacking India to win the first test at Eden Park by 40 runs after tea on the fourth day on Sunday.
India had looked favourites to win the match for much of the day before Wagner dismissed Virat Kholi (67) and Shikhar Dhawan (115) after lunch then removed Zaheer Khan (17) and Mahendra Singh Dhoni (39) in the evening session when the tourists were in sight of the 407 runs needed for victory.
Dhoni, the architect of a bludgeoning counter-attack after his side had been reduced to 270 for six after tea, was the ninth wicket to fall, effectively ending the chase with his side still 44 runs short of their target.
India, who were eventually dismissed for 366, were skittled out for 202 in their first innings, a deficit of 301 runs, but fought back brilliantly with the ball to give themselves a fighting chance of achieving an unlikely victory.
"I'm absolutely out of breath. That was a long hard toil of test cricket but it's an amazing feeling, one of the best feelings of my career," Wagner said in a televised interview.
"I'm overjoyed, overwhelmed. I'm also a bit shagged to be honest.
"The boys kept running in and you can see what this means to them as a unit. They toiled hard all day and it's a great feeling."
EBB AND FLOW
The final session typified the ebb and flow of the fourth day, with both sides at times holding the upper hand only for their fortunes to change over by over.
India had earlier looked favourites to win the match after lunch with Kohli and Dhawan well established and ready to guide their team home in the final session.
Wagner dismissed the dangerous Kohli to break a 126-run partnership with Dhawan, then had the opening batsman caught behind to give the hosts hope they could still win the match at Eden Park.
Trent Boult then dismissed Ajinkya Rahane before tea with the first delivery of the second new ball when he trapped the batsman lbw for 18, though television replays showed Rahane had got an inside edge before the ball hit his pads.
Southee then had Rohit Sharma caught behind by Watling for 19 on the first ball after tea to give the wicketkeeper his fifth catch of the innings and the fireworks began.
Ravindra Jadeja produced a beautifully timed off drive for a boundary on the first delivery he faced which sparked the counter-attack.
Jadeja and Dhoni raced to a 54-run partnership in 34 balls and looked to have seized the initiative back before Jadeja produced one shot too many off Boult and the ball flew to Ish Sodhi at mid-on.
Zaheer Khan continued in that vein, throwing the bat at the ball at every opportunity, but when he fell Dhoni was left to try to see his side to an unlikely victory.
When he was controversially bowled by Wagner, television replays suggested the bowler could have been called for a no-ball, India's pursuit effectively ended before it was finished when Ishant Sharma gave Watling his sixth catch.
The second test in the series begins at Wellington's Basin Reserve on Feb. 14. (Reporting by Greg Stutchbury in Wellington; Editing by Amlan Chakraborty)