It was New Zealand's lowest Test winning margin, extending the West Indies losing streak to seven, and came down to the stamina, accuracy and reverse swing of the home side's ace bowler Shane Bond on the fourth day.
The West Indies started the final day needing a further 45 runs with two wickets in hand, but added only 18 before Bond brought the innings to a halt.
Man of the match Bond ended the match with figures of five for 69, and was quick to acknowledge it was the big-hitting Gayle who turned the tide in his favour.
The pivotal incident came midway through the fourth day in a match of constantly changing fortunes.
With the West Indies set a second innings target of 291, Gayle and Daren Ganga opened in spectacular fashion with a 148-run opening stand.
But when Gayle smashed spinner Daniel Vettori into the stand for six, and the ball was lost, the West Indies were on the way to losing the Test as well.
The replacement ball provided the reverse swing which the New Zealand bowlers had been unable to produce until then, and from having all wickets intact and needing 143 to win, the West Indies were all out 115 runs later.
"The turning point was Chris whacking the ball up on the roof and we got a new ball and it reversed a few overs later and we exploited it well, we never gave up and we got the result," Bond said.
The replacement ball allowed Bond to run through the West Indies middle order with four quick wickets, including the first ball dismissal of Brian Lara, while Nathan Astle also moved the ball enough to take the key scalps of Gayle (82) and Ganga (95).
On the final morning, the West Indies hopes rested with Ian Bradshaw with New Zealand aware that as a No 9 batsman he scored 34 in a vital late partnership that steered West Indies to their 2004 Champions Trophy final win over England.
He lasted until Vettori's third over of the morning when a defensive shot took an edge off his pads and flew to New Zealand captain Stephen Fleming fielding in close to be out for 10.
His dismissal brought last man Fidel Edwards to the crease and triggered off Jerome Taylor who cracked two boundaries in the same over.
But it eventually proved to be in vain as Bond bowled Taylor for 13 to end the match.
New Zealand made 275 and 272 while the West Indies scored 257 in their first innings and 263.
The second of three Tests starts in Wellington on March 17.