The Kiwis began the final day on 182-6, chasing a target of 494, and hoping for rain and heroics from Vettori.
There was a weather hold-up after lunch, by which time Jacon Oram had been dismissed for 56.
But the rain relented and although Vettori made 140, he was last to go as Sri Lanka won by 96 runs, the 783rd Test victim for Muttiah Muralitharan.
The spinner took 3-85 but on this occasion was out-bowled by slow left-armer Rangana Herath, who sent down 48 overs for figures of 5-139 - the third time he had taken five wickets in a Test innings.
Vettori and Oram were together for the tourists at the start of play but they were lucky to survive a hostile early spell from pace bowler Dammika Prasad.
In the same over, he saw Vettori edge between first and second slip and then hit Oram on the pads, only for the umpire to reject a confident lbw appeal.
Muralitharan had to go off with a groin problem midway through his 21st over but Sri Lanka eventually ended a stand of 124 between the two batsmen when Oram was caught at cover off Tillakratne Dilshan.
The post-lunch session was delayed for 35 minutes by the weather but Muralitharan was able to return and he made a second breakthrough when Jeetan Patel (12) was caught at short leg.
New Zealand's resistance was not over, however, and Iain O'Brien joined his captain in a 69-run partnership for the eighth wicket, which used up an hour and a quarter.
Vettori reached his fourth Test hundred by hitting Muralitharan over mid-on for four and went on to make his highest Test score.
But he lost O'Brien when he edged a ball from Herath to the keeper and walked before the umpire could raise the finger.
And with only last man Chris Martin for company, Vettori eventually succumbed after a 189-ball innings, which included 16 fours, when he tried a sweep shot and was caught by Herath running in from deep mid-wicket.