Faced with an onerous task in their second innings, Bangladesh openers Zakir Hasan (33) and Shadman Islam (35) decided to counter-attack in their 62-run stand.
Yashasvi Jaiswal took a stunning left-handed catch in the slips to remove Zakir before Ashwin, who smashed a match-defining century in the first innings, produced a three-wicket burst.
Gill and KL Rahul took diving catches to dismiss Shadman and Mushfiqur Rahim respectively, while Mominul Haque lost his middle stump to the wily off-spinner.
While wickets tumbled around him, Shanto played his natural aggressive game bringing up his fifty with his third six.