Just when a five-game losing streak threatened to suck the wind out of Massachusetts, the Minutemen brought the excitement back with a 4-2 win over third-ranked Maine.

Stephen Werner got the game winner on a second-period breakaway in front of over 5,000 white-clad fans at the Mullins Center.

“We knew the crowd was involved and that was a good thing,” UMass coach Don Cahoon said. “I’m getting to find my away around campus these days and getting to know these students that are good fans of ours. Hopefully we can get seven or eight thousand fans in here on a regular basis and get this program headed in the right direction.”

After giving the Minutemen (16-15-1) a 3-1 lead, Werner iced the game with a sterling backhand shot. The freshman took a feed from Greg Mauldin and went top shelf for a 4-1 lead at 9:35 of the third period.

Chris Heisten scored a late goal to cut the lead to two. But Maine couldn’t mount much more offense. With the win UMass breaks a 14-game losing streak to Maine (22-6-5) that dates back to November of 1998.

Gabe Winer was sharp making 13 saves (28 total) during a second-period onslaught by Maine. His best stop came on a breakaway by Martin Kariya to keep the Bears down a goal.

“I thought [Winer] was fantastic,” Maine coach Tim Whitehead said. “I was really impressed. He made a couple great saves on a few breakaways.”

Howard was busy as well, as the Minutemen countered late. The freshman made 27 saves including a recovery to stop Steve Jacobs on the doorstep when it looked like he had a wide-open net.

“I thought he played great,” Whitehead said. “He made tremendous saves and gave us an opportunity to get back into that game and we didn’t seize that opportunity.”

UMass’ late power play was cut short by a penalty, but Werner turned the mishap into a scoring chance. Mike Warner hit the freshman streaking past the defense and he did the rest with a deke and a 3-1 lead to end the second.

“I played with Jimmy Howard last year and deke was always the way to go with him,” Werner said. “He’s pretty square most of the time, so it’s hard to beat him with a shot.”

Thomas Pock’s power-play goal opened the game’s scoring at 4:40 of the first. Marvin Degon slid a cross-ice pass to Pock for the one-timer and a 1-0 lead.

Thanks to UMass’ left-wing lock forecheck, the Black Bears did not have a significant scoring chance until seven minutes into the period when Winer pokechecked a Gray Shaneberger pass.

“The concept in that we wanted to make sure we applied pressure but we were in good defensive posture while we were doing so,” Cahoon said. “We felt the forecheck had gotten away from us. Hockey can be a very simple game and we kept it simple.”

Kariya found Francis Nault all alone at the point for a slapshot past Winer at 10:12 of the period to tie the game at one.

But UMass answered six minutes later with another power-play goal.

Chris Capraro nutmegged his mark in the corner before finding Degon in the slot for a one-timer. Howard made the first stop but Capraro sniffed out the rebound and stuffed it home for a 2-1 lead.