Vettori, who also took nine wickets, hit 76 to spare his team's blushes as the tourists reached the required 317 for seven wickets after tea on the last day.
Bangladesh have never beaten a big Test-playing nation with their only win in 53 matches coming against Zimbabwe three years ago. For New Zealand, it was a record run-chase away from home after their 164-4 against Australia at Perth in 1985.
Vettori, 29, anchored the batting with his second half-century of the match at Divisional Stadium, sharing a solid 45-run stand for the third wicket with Aaron Redmond (79) and then 82 for the sixth wicket with Daniel Flynn (49).
He was finally bowled by left-arm spinner Abdur Razzak with just 19 needed for victory. Vettori hit seven boundaries during his 214-ball knock and succeeded in countering the spin attack after promoting himself to number four.
With just one run needed, Flynn gave a simple catch off Shakib Al Hasan and it was left to Kyle Mills (one) to hit the winning run, with Jacob Oram remaining not out on eight.
Bangladesh had raised hopes of a famous victory when they removed Redmond and then Ross Taylor (nine) to restrict the tourists to 212-4 at lunch.
They then dismissed Brendon McCullum for two, trapped leg-before by Razzak, but Vettori and Flynn batted with authority and aplomb to avert an embarrassing defeat.
Bangladeshi skipper Mohammad Ashraful threw everything at the tourists, even taking the second new ball after 83 overs.
Although that brought Taylor's downfall, caught in the covers off Mashrafe Mortaza, it blunted whatever spin the slow bowlers were getting from the pitch.
Earlier Redmond and Vettori saw off the first hour after the tourists resumed at 145-2 until Bangladesh hit back through first-innings hero Hasan.
The left-arm spinner, who set a new Bangladesh innings record with figures of 7-36, had one turn sharply across Redmond's bat and the edge was held low by Zunaed Siddiqui at slip.
Redmond hit 10 boundaries in his 237-ball knock. The teams now move to Dhaka where the second Test starts from October 25.