Gustav Forsling and Sam Reinhart scored for Florida (57-17-6), which lost its second straight after a 13-game winning streak and has clinched the No. 1 seed in the East. Sergei Bobrovsky made 34 saves.
"I felt good. … It's unfortunate that we didn't win tonight, but it was a good game and was kind of the atmosphere of playoff hockey, for sure," Bobrovsky said. "Definitely, it's a good [test]. … They have a good team. It's a good fight, a good battle. It's great to have those games before the playoffs."
Jake DeBrusk gave the Bruins a 3-2 lead at 4:59 of the second when he batted in the rebound of Marchand's shot, and Marchand scored into an empty net for the 4-2 final at 16:55, ending an 11-game goal drought.
Forsling put the Panthers ahead 1-0 at 8:00 of the first with a wrist shot from the point through traffic after a Bruins turnover.
"I think after the first we weren't that happy about it, and we wanted to come up big in the second. It's a tight game," Forsling said. "We want to play games like this. It's a lot of fun to play on the road against a great team. I think it was a good test for us, and we're going to learn a lot from it."
Erik Haula tied it 1-1 at 16:18 with a one-timer from the bottom of the right face-off circle on a 2-on-1 with Pastrnak.
"Florida is a high-power offensive team, and keeping them to two goals is good," Haula said. "We just keep on growing our confidence. We're getting close to the end [of the regular season]. … Today was perfect. Glad we got the win."
Hall gave Boston a 2-1 lead six seconds later on a breakaway at 16:24 off a pass from Pastrnak after Florida turned the puck over off the face-off.
"It's nice to score goals," Hall said. "I wasn't the most confident shooter for a while there, but the last couple games, I've scored some goal-scorer goals. It's good to get that feel. It really is a feel. Some people chalk it up to luck or whatever. … If I can get that feel as we're heading into the playoffs, it's a good thing."