Jonathan Huberdeau had a goal and three assists and Mike Hoffman scored twice for the Panthers (28-25-10), who are eight points behind the Carolina Hurricanes for the second wild card into the Stanley Cup Playoffs from the Eastern Conference. Roberto Luongo made 41 saves.
"In our situation we can't be satisfied with one point," Huberdeau said. "In a game like this we have to manage two points."
Smith scored his second of the game to tie it 5-5 at 15:42 of the third period.
Stastny scored at 3:09 of the first period to give Vegas a 1-0 lead.
Florida responded with three unanswered goals. Hoffman scored twice on the power play, at 14:34 to tie it 1-1, and at 18:31 for a 2-1 lead.
Hoffman's second goal was his 30th, an NHL career high.
"You set personal goals, but what matters to me is that I'm contributing and helping the team in any way I can," Hoffman said.
Aaron Ekblad scored 28 seconds later to make it 3-1 at 18:59.
Vegas cut the lead to 3-2 at 7:40 of the second period when Smith went between his legs and scored stick side in front of Luongo. Merrill scored at 14:22 to tie it 3-3, and Colin Miller gave Vegas a 4-3 lead at 16:09.
Smith has scored three goals in four games after not scoring in his previous 12.
"Not much else had been working," Smith said of his first goal. "It was nice to see something go in. I hadn't had much puck luck lately. I'm running out of ideas in front of the net so I'm just trying to do anything to put some pucks on [the net]. It worked out, usually doesn't. Hopefully my luck is turning around right now."
Aleksander Barkov tied it 4-4 at 19:06, and Huberdeau scored at 3:18 of the third to give Florida a 5-4 lead.
"We got five, but I thought we could've had 10," Stastny said. "Sometimes you have games like that. It's fine. [Subban] played unbelievable and Luongo played unbelievable and they still allowed five goals. So sometimes it's unfair to those guys."