After spending nearly five months playing in the NHL for the parent Florida Panthers, Logan Shaw has returned to the Portland Pirates just in time to make some huge contributions.

Sunday afternoon, Shaw scored his second goal of the game with less than four minutes remaining to lift the Pirates to a hard-fought 3-2 win against the Hartford Wolf Pack at Cross Insurance Arena.

The victory clinched an Eastern Conference playoff berth for the Pirates, who have won five of their last six games and nine of their last 11.

“We set goals at the start of the year, and we obviously want to win the Calder Cup, and to start, we have to make sure we’re in the playoffs,” said Shaw. “Everyone contributed, and it was a lot of fun.”

Hartford needed to earn at least one point to still have a chance to catch the Pirates and could have closed to within two points with a regulation win. Instead, Portland moved back into fourth place in the Atlantic Division and stayed in contention for home-ice advantage in the first round of the playoffs. The Pirates are two points behind Wilkes-Barre/Scranton and Providence for second place with three games remaining.

“That was a playoff game for us, (and) we had to treat it like a playoff game,” said Shaw, who has four goals and two assists in five games since rejoining the Pirates on April 1. “Playoffs are close games and they come down to the last couple of minutes. We battled right through to the end, and that was huge for us.”

Portland plays its final home game Friday against fifth-place Bridgeport, then goes to last-place Springfield for games Saturday and Sunday.

“(Those games) are huge for us for positioning,” Shaw said. “We have to treat them like playoff games as well. We have to make sure we play 60 minutes every game.”

The Wolf Pack held a 1-0 lead at the end of the first period.

Less than four minutes into the game, Adam Tambellini finished off a two-on-one break with Chad Nehring to score his 16th goal of the season.

The Pirates went 13 minutes without a shot in the second period, but the drought ended when Shane Harper jammed the puck inside the left post for his 12th goal after circling around the back of the goal.

About three minutes later, Shaw put the Pirates ahead with Portland’s 14th short-handed goal, one behind Utica for most in the AHL. He received Corban Knight’s well-placed centering pass and put in a shot in from just outside the crease.

The lead lasted just 26 seconds before Hartford defenseman Mat Bodie tied the score with a shot from the slot while the teams were skating four-on-four.

Shaw’s winning goal was a low, hard shot from the hash marks under goalie Magnus Hellberg’s pads. It was his 11th goal in 18 games for the Pirates.

NOTES: Hartford defenseman Chris Summers, who played parts of four seasons with the Pirates, got into a fight with Connor Brickley in the first period. Both received five minutes majors. … Chris Brown, who spent two seasons with the Pirates while the team was affiliated with the Phoenix Coyotes, assisted on Bodie’s goal. … Portland forward Kyle Rau left the ice three minutes into the third period after taking a stick to the face and didn’t return.