BOSTON — The seniors on the University of Maine men’s hockey team have suffered their share of heart-breaking moments against archrival University of New Hampshire during their careers, including a pair of home losses in which the Black Bears squandered two-goal third-period leads.

They surrendered another two-goal third-period lead on an unseasonably warm and beautiful January night on Saturday in front of 38,456 at historic Fenway Park but, this time, the Black Bears triumphed thanks to two of those seniors: co-captain Brian Flynn and assistant captain Spencer Abbott.

Flynn’s goal 1:29 into overtime off assists from linemates Abbott and Joey Diamond gave Maine a thrilling 5-4 victory.

Diamond’s one-timer from the top of the left circle off an Abbott feed deflected into the net off the shaft of Flynn’s stick as Maine notched its fourth straight win and seventh in its last eight games.

The Black Bears, 10-7-2 overall and 7-6-1 in Hockey East, also snapped a four-game losing streak at the hands of the Wildcats, who are now 6-11-2 and 4-8-1, respectively.

UNH has lost five straight and seven of eight.

“I can’t say enough about it,” said Maine senior defenseman and co-captain Will O’Neill. “That’s the fashion we want to win in. We’re just finding ways to win games no matter if it’s at Fenway or where it’s at and that’s the most important part of it all.

“It was a gutsy win. I’m so proud of the guys. Everybody stuck with it. There were highs and lows in the game but we prevailed,” added O’Neill.

UNH’s previous comebacks weren’t a topic of concern.

“We’ve got an older team so we know we have to stick with it,” said O’Neill. “We can’t have any letdowns. We can’t take any shifts off. We talked a lot on the bench about keeping our focus and keeping everything going. We wanted the next goal.”

The team didn’t panic, Flynn said.

“We continued to play with confidence. We’ve been in this situation a number of times this year,” he said. “The guys stuck to the game plan and it eventually paid off. We just threw the puck to the net.

“Obviously, it feels great to get this win,” added Flynn, who is from nearby Lynnfield, Mass. “It’s a once-in-a-lifetime opportunity so to get this win in front of all the Maine fans who came down to support us as well as a ton of friends and family who were here and to win it in that fashion with my teammates, who also worked so hard tonight, is pretty special.”

Flynn was positioned just outside the crease with UNH defenseman Trevor van Riemsdyk behind him when he scored.

“(Abbott) had the puck and threw it to (Diamond). I just crashed the net and, fortunately, it just kinda’ hit my stick and popped over (UNH freshman goalie Casey DeSmith’s) head,” said Flynn, who scored an overtime game-winner to beat Providence 5-4 on Oct. 28.

Flynn has a team-high three game-winning goals this season — he also had one in the 6-3 win over Northeastern — and he has nine in his career.

Maine took a 3-2 lead in the second period with power-play goals 50 seconds apart from Diamond and Mark Anthoine just after UNH received a rare five-on-three shorthanded goal from Kevin Goumas.

DIamond scored again 13 seconds into the third period but Goumas sliced into the lead 2:47 later and John Henrion equalized 1:23 after that.

The teams swapped first-period goals before Goumas capitalized on a Maine turnover to score his shorthanded goal as he broke in alone on Maine goalie Dan Sullivan and wristed one in off the goalie’s blocker.

“I looked back at (Maine coach Tim Whitehead) and there was no chance he was going to take us off the ice after that goal,” said Diamond. “He knew we were going to come back and get a goal.”

Whitehead said, “Getting that five-on-three goal was key because it gave us a chance to get the five-on-four goal. That was a big bounce-back.”

Diamond tied it on the five-on-three as he directed an Abbott slap-pass behind the helpless DeSmith.

Anthoine’s second power-play goal of the game supplied Maine with its first lead as his high wrister from the left circle hit DeSmith and trickled in.

“I’m pretty sure it hit him in the face and dropped down,” said Lewiston’s Anthoine who now has five goals in his last five games and eight in his last 10. He extended his points streak to five games (5 goals, 1 assist).

Diamond made it 4-2 at the start of the third period as he took an Abbott pass, sliced freely across the net front and flipped it between DeSmith’s pads.

Diamond’s goal seemed to energize the Wildcats and force them into a sense of urgency and they were rewarded for their determined surge.

First, Stevie Moses raced into the Maine zone and left a drop pass for Goumas, who took a stride and beat Sullivan with a wrister over his glove.

Henrion equalized when he muscled a rebound past Sullivan as the puck trickled across the goal line inside the far post.

Henrion opened the scoring just 1:05 into the game by wristing home a Grayson Downing rebound. Anthoine equalized by swatting home a Kyle Beattie feed.

Seven of Antoine’s eight goals have come on the power play and the other is a shorthander.

Maine has now scored at least one power-play goal in 11 straight games (22-59, 37.3 percent).

“It was a heckuva’ game and a great atmosphere,” said UNH coach Dick Umile. “Obviously, we’re disappointed. We had an opportunity to win it, especially the way the guys battled back in the third period. But we didn’t get it done.”

Maine outshot UNH 33-24.

Sullivan finished with nine Grade-A (high-percentage) saves among his 20 and DeSmith, making just his second career start, had 14 Grade-As among his 28.

Beattie and O’Neill had two assists each and Diamond had one to go with his two goals.