Gayle's men survived a mid-inning slump to reach their Duckworth-Lewis adjusted target of 165 in 30 overs for the loss of six wickets.
All-rounder Majid Haq gave Scotland hope of an upset with a career-best return of four for 28. But Gayle, together with Darren Sammy, saw West Indies to victory with just a ball to spare.
Scotland had earlier made 152 for seven in 30 overs amidst the rain.
Daren Powell, set to join English county Hampshire after impressing for West Indies during their one-day series victory in England, took two early wickets to get rid of Fraser Watts and Haq before Scotland fought back.
In reply Gayle raced to 50 in 52 balls but Haq turned the tide after coming on in the 14th over.
He had Devon Smith caught sweeping for 32 before striking twice in two balls. Runako Morton was bowled by a beauty and Lendl Simmons then played on.
Dwayne Smith survived the hat-trick with six but fell soon afterwards before wicket-keeper Denesh Ramdin became another wicket for Haq and with four overs to go West Indies still needed 33 more to win.
But Gayle and Sammy held their nerve and paceman Dewald Nel couldn't prevent the duo scoring the nine runs they required off the last over.
Scotland 152 for 7 in 30 overs (N S Poonia 40, N McCallum 27, Watson 21; Edwards 2 for 17, Powell 2 for 25, Gayle 1 for 13) lost to West Indies 165 for 6 in 29.5 overs (Gayle 85 n o, Devon Smith 32; Majid Haq 4 for 28, Watson 2 for 21).