Bangladesh scored 221-3 in only 29.3 overs after Zimbabwe was bowled out for 219 at Shere Bangla National Stadium to level the five-match series at 1-1.
Shakib hit 15 boundaries and three sixes for his fourth ODI century, sharing in an unbeaten stand of 165 with Raqibul Hassan, who scored 39 off 75 balls.
Bangladesh openers Junaid Siddque and Tamim Iqbal raced to 44 off 23 balls before Elton Chigumbura caught and bowled Siddque for 23 in the fourth over.
Chigumbura removed Mohammad Ashraful for 3 in his next over, and Justice Chibhabha dismissed Iqbal for 26 on the very ball as Bangldesh fell to 56-3 in the seventh over.
Shakib and Hassan then put on Bangladesh's third highest ODI partnership to lead their team to victory.
Earlier, Razzak finished with a career-best 5-29 to run through the Zimbabwe batting lineup.
Zimbabwe made a steady start after winning the toss and batting, but lost regular wickets once captain Hamilton Masakadza was trapped leg-before-wicket for 34 while trying to sweep Naeem Islam.
Three wickets then fell with the score on 96 and Zimbabwe never fully recovered. Bangladesh did the real damage to Zimbabwe's batting order in the 21st and 22nd overs.
Justice Chibhabha was stumped by Mushfiqur Rahim for one of Mohammad Ashraful's two wickets, Brendan Taylor was bowled by Razzak and Charles Coventry was caught in the slips, also off Razzak.
Malcolm Waller replaced the injured Prosper Utseya and top-scored with 40 but he also fell to Razzak.
Ashraful finished with 2-28, while Islam took 2-43.