Connolly scored two goals, Aleksander Barkov and Jonathan Huberdeau each had two assists, and Sergei Bobrovsky made 28 saves for the Panthers (12-5-5), who have won three in a row and five of six.
Ondrej Kase had a goal and an assist, and John Gibson made 23 saves for the Ducks (10-10-3), who are 1-4-3 in the past eight games.
Anaheim led 4-0 after Kase scored at 18:39 of the second period before Florida rallied with two goals in the final 1:07 of the second and two goals in the third.
"They got a few lucky ones, I think," Ducks defenseman Erik Gudbranson said. "We're up by four. We lost. It's a tough pill to swallow. You gotta take this and feel everything that comes with it and understand it and just do a better job next time."
Connolly started the comeback, scoring twice in 27 seconds. He cut it to 4-1 at 18:53 and made it 4-2 at 19:20 with his 10th goal on a shot that went in off defenseman Cam Fowler. He has four goals in his past three games.
"The narrative will be the third period when it wasn't," Ducks coach Dallas Eakins said. "It was the last couple of minutes in the second where it's a simple play. We talk about moving the puck quickly. We don't. We turn it over. It's, bang, in our net. And that just gives them a little bit of jump.
"The second goal was a total fluke. It's off of Cam's glove. But the second one doesn't happen if the first doesn't, and we should be walking out of that period 4-0, and even if they do put up a push late like they did, they make it 4-2 or whatever, it's over."
Ekblad brought the Panthers within 4-3 at 11:55 of the third period, and Dominic Toninato tied it 4-4 when he one-timed Ekblad's pass at 15:37.
Max Jones gave Anaheim a 1-0 lead at 17:15 of the first period.
Nick Ritchie made 2-0 at 7:17 of the second on a one-timer after three quick passes followed a face-off win. Rickard Rakell scored on the power play for a 3-0 lead at 15:50.
"It was a fun game," Connolly said. "We didn't play very good in the first two periods, there's no question. But we got fortunate there at the end of the second with my lucky goal. That wasn't the prettiest goal I've ever scored, but guys kept working. We've been doing it all year and we just haven't quit on any games. It's obviously a huge positive when your group has that."