Dhoni and Dinesh Karthick (58 not out) put on a match-winning stand of 107 for the sixth wicket as the tourists, reduced to 144-5 chasing Bangladesh's 250-7, recovered to win with just six balls to spare.
It was India's first match since their humiliating first-round exit in the World Cup where they lost to Bangladesh in their opening game and also succumbed to eventual finalists Sri Lanka.
Dhoni, who came in at number three, anchored India's innings till the end and was supported by Karthick to turn near-defeat into a morale-boosting win.
But the stifling 38 degrees Celsius (100 Fahrenheit) heat, combined with 90 percent humidity, caused Dhoni to suffer leg cramps midway through his innings and Yuvraj Singh acted as runner for the hobbling batsman.
"I am just relieved to be able to stay there till the end because it was very hot out there," said Dhoni, who was later named man of the match.
"I think the conditions were tougher for the fast bowlers, but we did well to finish