STONY BROOK, N.Y. — Joe Harasymiak huddled with his players at the team hotel, and Maine’s first-year head coach laid out the win-or-else stakes for Saturday’s game against Stony Brook at LaValle Stadium.

“I just told them that it’s kind of like everything you want in a football game: ‘Everything is on the line. You have to win. We’re going to see what we’re made of when that’s on the line,’ ” Harasymiak said. “It’s hard to hide things from them. They knew the position we were in.”

Stony Brook was in the same position. Each team had the same overall and conference records. Each needed to win its last two to possibly claim an FCS playoff ticket. The loser would have no chance of earning a seventh win in its regular-season finale next Saturday to become eligible for the playoffs.

That made this virtually a playoff game. Maine responded by building a 27-point cushion, then holding on to claim a 27-21 win, its sixth of the season, all by seven points or less.

Senior quarterback Dan Collins hit 16 of 24 passes for 156 yards and two touchdowns. And freshman tailback Josh Mack ran a career-high 39 times for 147 yards and one touchdown, and caught one of Collins’ scoring throws.

So New Hampshire will now come to Orono with more than The Brice-Cowell Musket on the line. Both teams are 6-4 overall and 5-2 in the Colonial Athletic Association. Both will hope for a victory and an at-large invitation to the 24-team postseason party. The Black Bears haven’t been there since 2013.

“It would be huge,” Harasymiak said. “These kids have waited a long time.”

These kids were running away from the Seawolves. Collins tossed a left-side screen and Mack weaved through traffic for a 21-yard TD with 8:20 left in the third quarter to make it 27-0.

“The coaches know that if I get in space, it’s deadly,” Mack said.

But Donald Liotine countered by running the ball in from the 1 with 4:19 to go in the third for Stony Brook. Forty-six seconds later, Travon Reid-Segure raced into the end zone from 12 yards after intercepting Collins.

Then Liotine burst through the middle for a 50-yard score with 11:09 remaining in the fourth, and it was 27-21.

“We’re going to be in close games all the time,” said Maine defensive tackle Pat Ricard, who had an Indianapolis Colts scout checking him out. “We realize that. That’s kind of the style we play. That’s what it’s been all year for us.”

Najee Goode ended Stony Brook’s comeback, intercepting Pat Irwin’s pass with 1:29 left.

“Certainly, give Maine credit,” Stony Brook Coach Chuck Priore said. “Real proud of our guys for our second-half effort, our ability to be resilient and leave no regrets on the field.”

Mack got Maine going with a 12-yard touchdown run in the first quarter.

“The coaches trusted me with the ball,” Mack said. “They told me before the game, ‘Get ready because it’s going to be a long day.’ After the first touchdown I guess it opened eyes to just keep giving me the ball.”

Mozai Nelson grabbed the ball after Irwin fumbled a snap and raced 23 yards to make it 13-0 in the second quarter. Collins then threw a 2-yard fade to Jared Osumah with 28 seconds left until the intermission, and it was 20-0.

“All our players don’t want the season to end just because we’ve had a lot of success so far this year compared to last year and the previous year,” Ricard said. “So we definitely felt pressure to win this game, for sure.”