With the game on the line, Uehara recorded a five-out save after Detroit had battled almost all the way back from a four-run deficit.
The Red Sox took a 3-2 lead in the American League Championship Series which, after a day off Friday, will move back to Boston Saturday. A win in Game 6 will put Boston in the World Series for the third time in a decade.
Four of the five games played in the ALCS have been decided by one run, although this one looked as if Boston might run away thanks to an early offensive outburst that gave the Red Sox a 4-0 led.
Boston sent eight men to the plate while scoring three times in the second against Anibal Sanchez, who in Game 1 of this series did not give the Red Sox a hit through six innings.
Napoli scored Boston's fourth run on a wild pitch by Sanchez in the third.
Detroit produced single runs in the fifth, sixth and seventh to get back in the game, but double plays in both the sixth and seventh ended the Tigers' hopes of moving in front.
After Victor Martinez opened the Detroit eighth by grounding out, Uehara was called on to finish the game. He threw 27 pitches in shutting down the Tigers.
Jon Lester, having suffered the loss in Game 1 of the series, evened his playoff record at 1-1, limiting the Tigers to two runs on seven hits in 5 1/3 innings.
Boston schools pull out free condoms over wrapping complaints
NBC reportedly holds celebs hostage to Jimmy Fallon's show