McKay had earlier claimed three key wickets in his initial six overs which cost just 14 runs.
But his final 2.4 overs were wicketless and cost 32 runs as India cashed in on the fine knock of opener Gautam Gambhir (92).
After Australian batsmen David Hussey (72) and debutant Peter Forrest (66) laid the foundations for the home side's 8-269, Gambhir put India - minus resting star Sachin Tendulkar - within reach of their breakthrough win.
The 30-year-old overcame the bizarre loss of his opening partner Virender Sehwag after the pair raced beyond 50 within nine overs.
Sehwag (20) went to whip McKay's first ball over leg side fielders but played too early and somehow managed to spoon a catch with the back of his bat to backward point.
McKay struck again when Virat Kohli (18) lifted to Forrest at deep cover, with Gambhir and Rohit Sharma (33) then producing a threatening 76-run partnership.
But after Sharma's dismissal, McKay delivered another blow to India by trapping Gambhir lbw in a marginal decision as replays showed much of the ball pitched outside leg stump.
But Dhoni and allrounder Suresh Raina (38 from 30 balls) staged a 61-run partnership, broken by spinner Xavier Doherty in the 47th over when he bowled Raina with the visitors needing another 31 runs to win.
Doherty (2-51) struck again in the penultimate over when Ravi Jadeja was caught in the deep.
The Indians needed 13 runs from McKay's final over and the calm Dhoni guided his side to victory.
- AAP