BOSTON -- Jimmy Hayes had the first hat trick of his NHL career, and Patrice Bergeron and Matt Beleskey each scored two goals in the Boston Bruins' 7-3 win against the Ottawa Senators at TD Garden on Tuesday.
Hayes, a native of Dorchester, Mass., the largest neighborhood in Boston, had one goal in nine games since he was a healthy scratch for two games earlier this month. He has eight goals in his first season with the Bruins, who acquired him in a trade with the Florida Panthers on July 1.
"It's a dream come true and a pretty cool feeling," Hayes said. "It's always fun to score a hat trick in any league and to do in the NHL for your hometown team is great."
Tuukka Rask made 29 saves for the Bruins (20-12-4), who ended a three-game losing streak and earned a home-and-home split with the Senators after a 3-1 loss on Sunday. In that game, center David Krejci sustained an upper-body injury; he is week-to-week and was placed on injured reserve Tuesday.
The Bruins set a season-high for goals and had three players score two or more goals in a game for the first time since Dec. 28, 2001 (Bill Guerin, Mike Knuble and Glen Murray), according to the Elias Sports Bureau.
"You know, it's a team thing, and I think there are a lot of people that are capable of producing for us when we work well together, and that's what you saw tonight," Bruins coach Claude Julien said.
Boston defenseman Torey Krug and forwards Ryan Spooner and Loui Eriksson each had two assists. Krug missed the game Sunday because of an undisclosed injury.
The Bruins next play in the 2016 Bridgestone NHL Winter Classic against the Montreal Canadiens at Gillette Stadium in Foxborough, Mass., on Friday (1 p.m. ET; NBC, TVA Sports, SN).
The Bruins have a family skate planned in Foxborough on Wednesday before practicing there Thursday.
"There's no doubt it's always better to win a hockey game," Julien said. "I'm not going to lie about that. Our guys have played well, like I said, but haven't won. But the win makes it feel a lot better. Hopefully, we can enjoy the day [Wednesday] over there with family, relax, and then get back to work the following day preparing for that big game."
Goaltender Craig Anderson made 30 saves for the Senators (18-13-6), who are 0-5-1 in their past six road games. Chris Neil, Mika Zibanejad and Mike Hoffman scored.
"I hate losing and I lost, so it was a bad taste," Ottawa coach Dave Cameron said. "Upset, whatever, I hate losing."
A fortuitous bounce helped Hayes open the scoring. Defenseman Kevan Miller pinched down the right wall and tried to shoot the puck around the boards, but it hit something after leaving the corner and squirted out to Hayes in front of the net. Hayes tucked it between Anderson's left pad and the post at 8:01 of the first period.
The Senators tied it 1-1 on Neil's first goal in 30 games at 12:31. But Bergeron got the Bruins back in the lead at 2-1 during a power play before the period was through.
Boston started the second period on a power play, but it almost turned into a disaster. Rask had to stop Ottawa forward Dave Dziurzynski on a 2-on-1 at 00:59. After the big save, the Bruins cashed in when Beleskey beat Anderson with a one-timer at 1:21 for a 3-1 lead.
Anderson made his own big save on a Brad Marchand breakaway at 10:32, and that set the stage for the Senators to get back within one goal. Zibanejad beat Rask from the slot to cut the Bruins lead to 3-2 at 17:51.
Bergeron's second goal was a tip of a Krug shot at 2:38 of the third period to put the Bruins ahead 4-2.
Ottawa answered back to cut the lead to 4-3 when Hoffman took a sharp-angled shot that deflected off defenseman Dennis Seidenberg's skate out wide and eluded Rask at 4:22.
Hayes scored his second goal on a 2-on-1 with Max Talbot at 15:49. Beleskey scored his second goal 51 seconds later on a one-timer from the left circle for a 6-3 lead.
Hayes scored with 0.2 seconds left to complete his hat trick.
The Senators and Bruins combined for 110 penalty minutes. They next face each other in Ottawa on Jan. 9.