Chasing an improbable 437 for victory, Pakistan were reduced to 7-316 by stumps on Tuesday.
No.7 batter Mohammad Rizwan, on 75, was the last realistic hope for the visitors, with Sajid Khan with him on eight.
Salman Agha and skipper Shan Masood added 71 runs each to help Pakistan take the Test to a fifth day.
Left armer Taijul put Bangladesh on top, breaking the threatening partnership of Agha and Rizwan, who shared 134 runs for the sixth wicket to give Pakistan a glimmer of hope.
Taijul bowled Agha with a slider to break the stubborn rearguard before removing Hasan Ali for duck.
Fast bowler Nahid Rana took 2-58 with raw pace that troubled Pakistan throughout the day. He gave Bangladesh the first breakthrough when he dismissed Abdullah Fazal (6), who steered a short-pitched ball to gully.
Soon after, off-spinner Mehidy Hasan trapped Azan Awais lbw for 21, giving Bangladesh control of the game.
Masood and Babar Azam resisted, negotiating Nahid Rana's bowling well and keeping the runs flowing.
Their 91-run stand came to an end when Taijul had Babar caught behind down the leg side for 47.
Saud Shakeel then edged a pacy delivery off Nahid behind while Taijul had Masood caught at short-leg, leaving Pakistan 6-162 as Bangladesh sensed a victory inside four days.
Bangladesh was bowled out for 278 in the first innings, thanks to Litton Das' 126 before dismissing Pakistan for 232.
The hosts rode on a 137 from Mushfiqur Rahim to put on 390 in the second innings, setting Pakistan the 400-plus target for a series-levelling victory.
No team has successfully chased more than 418 runs for victory in Test cricket.