Pakistan reached 127 for 3 in 19 overs in reply to West Indies' 124-8.
The tourists won the toss at Queen's Park Oval and put West Indies into bat, and Chadwick Walton top-scored on 40 with four sixes and two boundaries for the hosts.
From 52-1, West Indies slumped to 83-7 as Hasan Ali (2-12) and Shadab Khan (2-16) produced economical spells.
Some late hitting from Carlos Brathwaite, who scored an undefeated 37 from 24 balls, gave West Indies something to bowl at but it appeared unlikely to be enough.
With the target down to 15, both were dismissed in quick succession by Kesrick Williams, who bowled Shehzad with the last ball of one over and had Azam caught by substitute Rovman Powell with the first ball of his next.
Sarfraz Ahmed survived the hat-trick ball and Shoaib Malik was dropped before the pair saw Pakistan across the line with an over to spare.
Disclaimer: No Business Standard Journalist was involved in creation of this content