HARRISBURG, Pa. — Having locked up the franchise’s first Eastern League playoff berth since 2008 hours earlier in the night, the Portland Sea Dogs pulled off a comeback victory for good measure Tuesday.

Keury De La Cruz snapped a tie game with a solo home run in the eighth inning and the Sea Dogs rallied past the Harrisburg Senators 5-4 at Metro Bank Park.

Stefan Welch hit a two-run homer in the fourth and Carson Blair’s first Double-A homer in the sixth made it 4-4 for the first-place Sea Dogs (79-50), who extended their lead to two games over second-place Binghamton in the Eastern Division. The Mets (77-52) lost 7-0 at Erie.

Even though Portland technically reached the postseason around 8 p.m. when the New Britain Rock Cats lost to the Richmond Flying Squirrels and were mathematically eliminated, the staff didn’t readily share that news with players. They only got to celebrate with beer and champagne showers after the final out of a game they once trailed 4-1.

“My approach is, ‘Take care of what you can take care of,’ ” Portland Manager Billy McMillon said. “It was a welcome relief knowing that New Britain lost, but in the midst of our game we still needed to take care of business.

“It was good to see that even down three runs early the guys didn’t give up. And as far as postseason play, it was a goal of ours but we don’t talk about it all the time because it’s about development (in the minors). The guys worked hard all year, though, through the cold and long bus rides. I’m glad they’re able to savor this moment. Some of these guys have never been to the playoffs before. It’s special, for sure.”

Right-handers Pete Ruiz (3-1) and Noe Ramirez were strong out of the bullpen, slamming the door time and time again on the free-falling Senators (49-79), who dropped their sixth straight and fell to 2-14 in their last 16 games.

Portland led 1-0 on Michael Almanzar’s fielder’s-choice groundout in the first, but Harrisburg answered with a grand slam from Jason Martinson in the home half off Portland starter Luis Diaz.

Portland slowly chipped away and reduced the deficit to 4-3 in the fourth. The Sea Dogs chased starter Austin Voth when Welch followed Blair’s leadoff single with a two-run homer into the right-field bleachers, just below the scoreboard.

Paul Demny relieved Voth and surrendered a double to Jonathan Roof, who eventually moved to third on a groundout. Roof tried to score on Ryan Dent’s fly to left but was out at the plate on a strong throw from Ricky Hague.

Blair pulled the Sea Dogs even with one out in the sixth, mashing a 3-1 Demny pitch high over a ribbon board that sits atop the boardwalk in left-center field for a 4-4 tie.

Ruiz got out of jams in the sixth and seventh to keep the game even until De La Cruz hammered a Neil Holland pitch into the Senators’ bullpen beyond the right-field fence.

“I was looking for a fastball but I took a pitch because I don’t know (Holland),” De La Cruz said. “I thought it was inside but the umpire called it a strike. It was a slider and it didn’t break a lot. When he threw it again, I made a good swing. It felt great to come through like that.”

It wasn’t an easy ride to the playoffs for the Sea Dogs, who started out 59-29 but have gone just 20-21 since. Key players such as Mookie Betts, Henry Owens and Blake Swihart, among others, were promoted to Triple-A.

“We put ourselves in a great position with our start and we were one of the best teams in all of baseball,” said Shannon Wilkerson. “Guys who deserved it got moved up and we’re happy for them. They were great teammates. But the guys who came up from (Class A) Salem have done a great job filling their roles. We’re excited about going to the playoffs.”