The tourists had reached 331-5 in their first innings by stumps on the third day, trailing Bangladesh's total of 433 by 102.
Masakadza made the most of the home team's sloppy fielding to hit 17 fours and two sixes after starting the day on 15.
He was dropped thrice by the same fielder, Shamsur Rahman, in the slips when on 15, 19 and 74. Rubel Hossain, Taijul Islam and Shakib Al Hasan were the unlucky bowlers.
Masakadza, who made just one half-century in six previous Test innings in Bangladesh, shared an unbroken stand of 142 with Regis Chakabva (75 not out) for the sixth wicket.
More From This Section
Masakadza celebrated his fourth Test century with a boundary off Shakib through the third man region.
Shakib, bowling steady left-arm spin, picked up the wickets of Brendan Taylor (37), Craig Ervine (17) and Elton Chigumbura (one) in the post-lunch session to reduce Zimbabwe to 189-5.
But Masakadza and Chakabva defied the spinners in the entire final session to lead a spirited fightback.
Bangladesh lead the three-match series after winning the first Test in Dhaka by three wickets last week.
The Tests will be followed by five one-day internationals.