Bangladesh, starting the third day at 58-5 in reply to India's mammoth 610-3 declared, were shot out for 118 just before lunch at the Sher-e-Bangla National Stadium.
The hosts were 10-1 in their second knock at the break, losing opener Javed Omar for a first-ball duck to Zaheer for the second time in the match.
Omar, who was held in the slips in the first innings, was unlucky to be given out caught by the wicket-keeper down the leg side as television replays showed the bat did not deflect the ball.
Shahriar Nafees was unbeaten on four and captain Habibul Bashar was on five at lunch as Bangladesh faced an uphill task to save the match and the series.
The first Test in Chittagong was drawn after rain washed out 15 of the scheduled 30 hours of play.
Zaheer, who had taken three wickets the previous evening, struck with the day's second delivery when he trapped Saqibul Hasan leg-before.
Left-handed Saqibul failed to add to his overnight score of 30.
Khaled Mashud and overnight batsman Mohammad Sharif took the score from 58-6 to 85 when spin spearhead Anil Kumble trapped Sharif leg-before for 13.
Debutant seamer Ishant Sharma picked up his first Test wicket as Mashrafe Mortaza slashed a short ball into Kumble's safe hands at gully to reduce Bangladesh to 93-8.
Zaheer completed his fourth five-wicket haul when he bowled Mohammad Rafique, before Kumble terminated the innings by making Mashud (25) edge a catch to wicket-keeper Mahendra Dhoni. Kumble finished with 3-32.