Mahmudullah took 2-38 to help the home team bowl the tourists for 217 in 48 overs and then scored a polished 48 to help the home team chase down the target for the loss of eight wickets with six overs to spare.
Bangladesh won the first match by seven wickets and the second by 160 runs -- both in Khulna. The West Indies levelled the series with a four wicket win in the third and 75 runs in the fourth.
Both teams will now play a Twenty20 international in Dhaka on Monday.
It was Mahmudullah and captain Mushfiqur Rahim (44) who set the home team on the victory path through their 91-run stand for the fourth wicket after paceman Kemar Roach (5-56) had derailed them in early overs.
Roach struck thrice in his first five overs, removing Tamim Iqbal (eight), Anamul Haque (nought) and Jahurul Islam (10) to leave the home team in disarray at 30-3.
Mahmudullah hit seven boundaries in his 45-ball knock while Rahim smacked as many boundaries in his 56-ball knock.
But the West Indies staged a comeback through Sunil Narine (3-38) as the spinner removed both the batsmen in the space of 12 runs.
Nasir Hossain (39 not out) and Mominul Haque (25) added 53 for the sixth wicket as Bangladesh survived a late order slump to reach the target. Nasir hit Andre Russell for the winning boundary to send the packed crowd into jubiliation.
Earlier, Kieron Pollard hit a return to form with a robust 74-ball 85 and Darren Bravo notched a sedate 108-ball 51 during their 132-run fourth wicket stand to lift the tourists to 217 after they were put into bat.
Bangladesh had removed Kieran Powell (11), Marlon Samuels (one) and Chris Gayle (two) by the eight over.
Paceman Shafiul Islam, who replaced injured Mashrafe Mortaza in the squad, dismissed Gayle for a fifth failure in as many matches to finish with 3-31 in his nine overs.
Pollard, who like Gayle was a big flop in the last four matches, hit a six for his first scoring shot as he batted with aggression. He hit five boundaries and eight towering sixes to take the attack to the Bangladeshi bowlers.
He was finally dismissed in the 32nd over, bowled by spinner Haque. The Pollard-Bravo stand for the fourth wicket is a new record in all West Indies-Bangladesh one-dayers, beating the 92-run stand between Jimmy Adams and Shivnarine Chanderpaul in Dhaka in 1999.
Bravo hit three boundaries and a six before he was caught off Mahmudullah who finished with 2-38.
Devon Thomas chipped in with a useful 25 to take the West Indies past the 200-run mark.