Zimbabwe had set an imposing target of 477 for the win, and made a good start by reaching 110 for one, before the wicket of the experienced Brendan Taylor (92 from 73 balls) started their slide.
They resumed on the fifth morning on 140 for three, but lost four quick wickets when Mehidy (4-66) and Taskin (4-82) ripped through the middle-order.
#OneOffTest | Day 5: WICKET! Richard Ngarava (10) b Mehidy Hasan Miraz🇿🇼 276 & 256 all out in 94.4 overs, 🇧🇩 won… https://t.co/yGWrg2rz40
— Zimbabwe Cricket (@ZimCricketv) 1626006436000
Donald Tiripano (52) held up the Bangladeshi charge, but when he was the ninth wicket to fall, the tourists were able to record just their fifth ever away test win in 59 matches, and their first since beating Sri Lanka in Colombo in 2017.
It is their second victory in Zimbabwe, with the other two away wins both coming in the West Indies in 2009.
The teams will now contest a three-match One-Day International series starting on Friday, which will be followed by three Twenty20 matches.