Chasing 172 to win, hosts West Indies lost seven wickets for 65 runs before big hitting by Hosein (44 not out off 16 balls) and Shepherd (44 not out off 28 balls) took them to 170-8 in 20 overs.
The West Indies had needed 30 runs off the final over, bowled by Saqib Mahmood, and Hosein almost got them there by smashing 28, including three sixes off the last three balls.
"I'm delighted, even with the last quarter of the game, these are the games we want to play in, tight games to work on death hitting and bowling," England skipper Eoin Morgan said.
"But the majority of the day we adapted well, with more intent and clarity. We need to establish the rhythm of the game, not necessarily fluent partnerships ... dot, dot, dot, wicket, boundary. But we countered what West Indies had to offer."
England, who scored 103 in their opener, put up a more challenging total on Sunday with Jason Roy scoring 45, while Moeen Ali (31) and Chris Jordan (27) also chipped in.
Moeen later excelled with the ball, bagging 3-24 to choke the West Indies, while Adil Rashid claimed two wickets.
West Indies skipper Kieron Pollard said he was pleased with his team's effort heading into Wednesday's game.
"I can see the confidence with the guys in the changing room. We'll have days like this but my thing is the fight that the guys continue to show," Pollard said.