The tourists, resuming on 122-1 overnight, lead by 260 runs after holding a one-run advantage after the first innings.
Gambhir reached his fifth century in five consecutive matches in grand style, charging Bangladesh captain Shakib Al Hasan down the track for a long-on six.
He became only the fourth batsman to score centuries in five consecutive tests after Don Bradman, Jacques Kallis and Mohammad Yousuf. Bradman holds the record with six centuries in six tests.
The left-hander, who resumed his batting in the morning on 47, had a let off when Imrul Kayes dropped him on 55 at forward short leg off Shakib.
Debutant pacer Shafiul Islam ended Gambhir's innings on 116 for his first test wicket. Shahriar Nafees took the catch at third man to send back Gambhir, who faced 129 balls and struck 10 fours and a six.
Bangladesh had earlier got rid of nightwatchman Amit Mishra, caught by Tamim Iqbal off Mahmudullah for 50 off 70 balls, his maiden test fifty. Mishra, unbeaten on 24 overnight, clubbed six fours.
Rahul Dravid was the other batsman to be out in the morning for 24 with a direct throw by Shakib from short mid wicket.
Mishra and pacer Zaheer Khan claimed three wickets each as Bangladesh were all out for 242 runs in their first innings.Tendulkar dominated India's first innings of 243 runs with 105 not out, his 44th test century. Shakib (5-62) and Shahadat Hossain (5-71) shared all 10 wickets in the Indian innings.