Michael Frazier II had given the Gators a 64-63 lead with 19 seconds left on a layup off an assist by Casey Prather.
But on the Huskies' final possession, Napier scrambled his way through a double-team and forced up a shot that glanced off the backboard.
The ball, however, was back-tapped to him by a teammate and he followed with a last-second shot from the top of the key that swished through the net for the game-winner.
Napier went 5-of-8 from 3-point range and DeAndre Daniels provided 14 points with seven rebounds for unbeaten UConn (8-0).
Prather supplied 19 points and seven rebounds for Florida (6-2).
Patric Young contributed 17 and seven and Scottie Wilbekin added 15 points before going down with an ankle injury late in the contest.