Ovechkin's second hat trick of the season gave him 23 goals for the season and 14 in his last 13 contests for the Capitals, who built a 4-0 lead but then had to hold on down the stretch to secure the win.
Mike Ribeiro also scored for Washington, which reeled off its third straight win and remained tied with the Winnipeg Jets for the Southeast Division lead.
Braden Holtby earned the win, stopping 27-of-30 shots.
Tomas Kopecky scored twice and Peter Mueller also registered a goal during a third-period rally for the Panthers.
Jacob Markstrom made 27 saves for Florida.