The on-again, off-again Portland Pirates were somewhat on Friday night.

Playing before the largest crowd of the new year at the Cross Insurance Arena, the Pirates snapped a two-game losing streak by grinding out a 4-2 win against the Bridgeport Sound Tigers.

Two nights after blowing a 2-0 lead in the third period of a 3-2 loss the Worcester Sharks, the Pirates pulled out a victory before an announced crowd of 3,993.

“Our energy was better, (but) our execution was poor,” Portland Coach Ray Edwards said. “Bridgeport worked extremely hard, (and) it was a hard game for us. We worked, but we weren’t clean. We fought the puck all night, but we found a way.”

Left wing Lucas Lessio and defenseman Brandon Gormley, both in their second game back with the Pirates after lengthy NHL stints with the Arizona Coyotes, scored a goal apiece to help the Pirates snap a two-game losing streak on their home ice.

“We played better tonight,” Gormley said. “We still gave up a lot of chances, (but) we found a way to win and that’s what it’s all about.”

The Pirates held a 2-1 lead after the first period.

Bridgeport’s John Persson opened the scoring less than nine minutes into the game when he flashed down the left side and beat goalie Louis Domingue to the glove side with a wrist shot from the middle of the left circle. It was the eighth goal of the season for Persson.

Three minutes later, Brendan Shinnimin tied it when he poked the puck in for his ninth goal as goalie Kevin Poulin, who was sprawled facedown on the ice with most of his body inside the goal, tried unsuccessfully to reach for the loose puck with his glove.

Lessio, who had an assist on Shinnimin’s goal, snapped the tie with his 10th goal. After weaving his way through Bridgeport’s forwards in the neutral zone, he split the defense and put in a hard shot from the top of the slot.

“I saw a pretty gap, and when they held me up I just tried to get it past the first guy,” Lessio said. “I tried to get off a quick shot, and luckily it went in.”

Midway through the second period, Bridgeport’s Mario Lamoreaux tied the score by putting in a one-timer from the slot for his first AHL goal. The younger brother of former Pirates goalie J.P. Lamoreaux, he converted Colton Gillies’ centering pass from the bottom of the left circle.

With two minutes left in the second period, Gormley put the Pirates back in front by slipping a left-handed shot from the bottom of the left circle past Poulin.

“It’s definitely different jumping back and forth between teams, but it’s all part of being a young NHL player,” said Gormley, who spent nearly four weeks with the Coyotes. “It’s good to keep playing here.

Eric Selleck completed the scoring with less than five minutes remaining, turning rookie Tyler Gaudet’s behind-the-back centering pass from the left circle into his sixth goal of the season.