Kyle Mayers dismissed Babar Azam (55) early on day four to ensure West Indies had an opening.
Jayden Seales picked up five wickets - and became the youngest from West Indies to bag a Test five-fer - to keep Pakistan to just 203. West Indies were left needing 168 to take the series lead.
Shaheen Afridi bagged three wickets to leave West Indies hurting at 38 for 3 at lunch.
Jermaine Blackwood made 55 to take West Indies close to the target but fell in the second session to Hasan Ali.
Faheem Ashraf and Hasan Ali picked two wickets each in the second session to leave West Indies struggling at 114 for 7 at Tea.
Kemar Roach (30*) helped West Indies seal a one-wicket win as the hosts chased down 168. Seales remained unbeaten on 2 off 13 and was awarded the Player of the Match for his eight wickets in the game.