The win means the home side claimed the three-Test series 2-0.
Set 122 to win the Test after bowling the tourists out for 103 on the third day, the hosts knocked off the runs required, losing opener Peter Fulton (10) and Williamson (56) along the way to posting 2-124.
Williamson fell with six runs still required, leaving it to Hamish Rutherford to hit the winning boundary to finish unbeaten on 48 at the end with man of the series Ross Taylor alongside him.
The hosts went to lunch requiring 33 more runs and wasted little time in knocking off the winning runs in the ninth over after the resumption.
Williamson went to his 12th Test 50 with two successive pull shots off Tino Best, while Rutherford, who had struggled in the opening session, was more circumspect.
It came as a surprise when Williamson, who had looked sure to see the hosts over the line, missed a Veerasammy Permaul ball that he tried to pull to the boundary and it crashed into his stumps.
Off-spinner Sunil Narine who claimed 6-91 in New Zealand's first innings of 349 was the biggest threat before the interval but went unrewarded and was not used after the break.
Earlier captain Darren Sammy got the sole breakthrough, pouching his fourth sharp chance of the match, and his second caught and bowled, to remove Fulton.
There was the odd scare for the home batsmen, with Rutherford living dangerously, and it was slow going at times, but the tourists could not get the wickets to send the jitters through the New Zealand camp.
It ends a series where New Zealand, ranked eighth in Test cricket dominated their sixth-ranked opponents and were only denied a clean sweep when rain intervened in their quest for 112 to win the opening Test in Dunedin.