Gary Roberts also scored for the Panthers and Ed Belfour had 23 saves. Florida snapped a three-game losing streak.
Fredrik Sjostrom and Keith Ballard scored for Phoenix, which lost for the fifth time in seven games. The team failed to gain ground in its push for the Western Conference playoffs.
"I didn't like what transpired," Gretzky said. "It wasn't pretty to watch. We got beat pretty much all over the ice."
Phoenix held a players-only meeting after the game that lasted about 10 minutes.
"Guys hate losing," Coyotes captain Shane Doan said. "We're disappointed with our effort. As players, you don't want to accept that."
Curtis Joseph had 25 saves on 29 shots for Phoenix before he was replaced by Mikael Tellqvist with 17:22 left. Tellqvist finished with eight saves on nine shots.
"We got some strong performances from different people," Florida coach Jacques Martin said. "Our leaders came out and played hard and Eddie made some good saves for us."
The Panthers took a 1-0 lead on Horton's goal at 9:10 of the first. Horton picked up the puck below the right circle, brought it around behind the net, and scored on a wraparound to Joseph's stick side.
Florida stretched its lead to 2-0 on Jokinen's power-play goal at 12:39. A shot by Horton went wide and bounced off the end boards. Jokinen pounced on the puck and poked it into the corner of the net.
The Panthers took a three-goal advantage in the second. Roberts brought the puck between the circles and beat Joseph with a backhand at 14:09.
"We capitalized on all our chances," Jokinen said. "It was a good, solid team game for 60 minutes."
Florida went ahead 4-0 at 1:45 of the third when Gelinas took control of a loose puck in front of the net and shot it past Joseph, who was replaced moments later.
"We didn't have enough guys going to the hole, throwing the puck to the net," Phoenix's Jeremy Roenick said. "We just didn't move the puck well."
Sjostrom's goal cut Phoenix's deficit to 4-1 at 6:41 of the third. Florida answered 35 seconds later on Gratton's shot from the right circle that got past Tellqvist. It was Gratton's 200th NHL goal.
"The win is more important," Gratton said. "I didn't even know it was coming up. Unfortunately, it took me 13 years to get there. It was a good win for us."
Ballard's power-play goal at 16:03 made it 5-2.
Yanic Perreault, Phoenix's second leading scorer, didn't play because of a shoulder injury. ... Florida recalled C Drew Larman from Rochester of the AHL. ... Florida's Chris Gratton and Phoenix's Josh Gratton are second cousins. They played against each other for the first time in the NHL.
Copyright by STATS LLC and The Associated Press
Arena: BB&T Center Location: Sunrise, Florida
Referees: Don Koharski, Chris Rooney Linesmen: Jean Morin, Brian Murphy
Attendance: 15,312 (79.5% full)
Team Stat Comparison
Power Play Goals
Power Play Opportunities
Shots on Goal
Nathan Horton (18)
Assists: Martin Gelinas, Bryan Allen
Olli Jokinen (24)
(Power Play) Assists: Nathan Horton, Mike Van Ryn
Gary Roberts (13)
Assists: Chris Gratton, Martin Lojek
Martin Gelinas (10)
Assist: Juraj Kolnik
Fredrik Sjostrom (8)
Assist: Jeremy Roenick
Chris Gratton (9)
Assist: Olli Jokinen
Keith Ballard (2)
(Power Play) Assists: Zbynek Michalek, Ladislav Nagy