Like his team, Drew Stafford went from frigid to sweltering. The turnaround got them off the beaten path.

Stafford, who’d been plodding through a career-worst slump, scored the opening goal and helped key a third-period rally that gave Buffalo a 4-2 victory over Boston on Friday. After getting booed off the ice following the second period, the Sabres scored three times in the third to bring life to First Niagara Center.

“It’s just a character win against a team like that,” Stafford said. “It always feels good to beat them, and it’s definitely a statement by us to be able to come back. I think in the third period we were by far the better team.”

Stafford was by far the best dressed.

During the postgame celebration, the right winger donned a dark brown fur coat emblazoned with a Sabres logo on the back. After being given the cold shoulder by many during his slump, he was the center of attention in the dressing room. As sweat poured off his face, he was ready to go back into the shadows.

“This jacket’s really hot, so I kind of want to get this over with,” he said with a smile to the pack of media personnel.

Stafford had every reason to celebrate after scoring the first goal, but the Sabre with the biggest drought kept it calm – on the outside, anyway.

“That’s something I’ve been working for, and finally it’s nice to get rewarded,” said Stafford, who went 17 games without a goal. “I’ve been waiting for it to happen. Finally, it went in. It was a good feeling.

“More importantly, it’s not about me in here. It was a great win by the guys, and I was glad to contribute and hopefully continue.”

Stafford’s first goal since March 31, 2012, gave Buffalo the lead just 3:24 in. Boston’s Dougie Hamilton closed an evenly played opening period by scoring his first NHL goal with 2:04 left.

Boston took over following intermission. The Sabres fell into their typical second-period slump. They entered the night with a league-worst 24 goals allowed in the second, and Boston’s Rich Peverley quickly struck for the 25th.

The Sabres went through the motions for the rest of the period and were booed off the ice at the end of it. The Bruins enjoyed a 17-6 shot edge during the 20 minutes. They could have easily skated into the second intermission with a bigger lead, but Miller made 16 of his 30 saves during the period to keep the Sabres close.

“That’s what you’ve got to do in this league. You’ve got to stay there,” Miller said. “The guys played a great third period. We really stepped up and did a nice job.”

Tyler Myers, benched twice last weekend, knotted the game 2:03 into the third. Boston goalie Anton Khudobin stopped Jochen Hecht on a two-on-one, but Myers swooped in for the rebound.

The Sabres continued their rally and reclaimed the lead with 10:58 to go. Tyler Ennis and Stafford entered the Bruins’ zone with speed. A save of Stafford’s shot ended up on the stick of Christian Ehrhoff, and the defenseman ripped home the winner from the high slot to get the sellout crowd of 19,070 in a believing mood.

“The good part is we came out at the start of the third and came right after them, and we took control of the game,” Sabres coach Lindy Ruff said.

Myers sent Boston to just its second regulation loss – both at the hands of the 6-8-1 Sabres – when he carried the puck deep into the Bruins’ zone and fed Cody Hodgson for a tap-in at the post with 8:15 left.

“Just hopefully we learn from that period and apply it to a whole game,” said Miller, who returns to the ice Sunday afternoon against Pittsburgh and took extra contentment in beating the Northeast Division leaders Friday. “We recognize the rivalry. I know the guys recognize it as a measuring stick. They’re one of the elite teams. We step on the ice, you want to prove you belong. That’s what it comes down to for me. I think it’s a shared feeling around the room.”