The result means that the Kiwis lead 2-0 with two matches of the five-game series left to play.
© Getty Images
Batting first, the hosts posted a commanding score of 314.
India looked on course to eclipse that total with 32 balls of their chase remaining when, with four wickets in hand, they needed another 46 runs to win.
Ashwin smashed McCullum to the mid-wicket rope where Guptill displayed some brilliant quick-thinking and agility to prevent a six and claim a vital wicket.
All Indian hopes then rested on Ravindra Jadeja's shoulders and, although the tail-end wickets of Bhuvneshwar Kumar (4) and Mohammed Shami (2) fell around him, he was able to keep his team in the game with some meaty hitting.
India went into the final over needing 18 to win and victory appeared to be in sight when Jadeja smashed Corey Anderson for six off the penultimate ball of the match.
That left the tourists needing two to win, but they could only scramble a single.
Jadeja ended unbeaten on 66 from 45 deliveries alongside Varun Aaron (2*). Meanwhile, despite going for 17 off his final over, Anderson finished with figures of 10-1-63-5.