Centuries from Pakistan opener Usman Khan and captain Farhan Yousuf helped the tourists post 332 for nine. The pair combined for a match-defining 268-run stand after Taylor had taken two early wickets.
Ali claimed his five wickets in the space of 10 balls – including three in the final over. The 17-year-old took his first wicket when Khan, who struck 151 from 136 balls, was bowled around his legs attempting to ramp the right-armer.
Opener Isaac Mohammed struck 72 but lacked support in the chase as the hosts were bowled out for 155.
Luke Symington (Durham) and Tom Edwards (Glamorgan) joined Ali in making their England Men U19s debuts.
The second match of the series will be played at Guildford on Saturday.