McAvoy tied it 1-1 at 17:14 on a 5-on-3 slap shot from the high slot. McAvoy briefly exited earlier in the period after colliding with Panthers forward Carter Verhaeghe and the end boards.
Anton Lundell gave the Panthers a 2-1 lead at 4:41 of the second period, beating Swayman blocker side from the left circle off a cross-ice feed from Nick Cousins.
"They're a good team, high offensive power," Swayman said. "Obviously, I was wanting to make some saves in a timely [manner], but they definitely capitalized, so want to learn from that and definitely take the positives and move forward."
Barkov pushed it to 3-1 at 15:31 of the second on the power play, redirecting Brandon Montour's point shot.
"We haven't been winning [as many] games as we want to," Barkov said. "At the same time, I think it's about building the game, and feeling more and more comfortable on the ice and later in the season. … Right now, especially, we need to win some games, and against Boston, it was [a] huge one."
Tkachuk made it 4-1 at 19:46 with a power-play redirection from Swayman's right post, extending his goal streak to four games.
"[Tkachuk's] got one of those unusual set of hands that within two or three feet of the net, he gets a stick on everything," Maurice said.