Less than a year ago, LIU Brooklyn looked like a lost program. As it turns out, the Blackbirds knew who would take them where they wanted to go.

Under first-year head coach Derek Kellogg, fourth-seeded LIU Brooklyn clinched an improbable ticket back to the NCAA Tournament after upsetting top-seeded Wagner, 71-61, in the Northeast Conference championship game Tuesday night at the Spiro Sports Center in Staten Island.

LIU Brooklyn (18-16), which didn’t have a winning record this season until completing a 14-point comeback against Fairleigh Dickinson in the semifinals, will return to the Big Dance for the first time since its three-peat earlier in the decade (2011-13). The Blackbirds will be a 16th seed, as the first New York City team in the NCAA Tournament in three years.

One year ago, Kellogg, 44, had just finished his ninth year as head coach at his alma mater, Massachusetts, while Jack Perri, coaching LIU, had earned his first 20-win season since leading the Blackbirds to the 2013 NEC championship. By the end of March, both coaches had been fired, and LIU’s position remained vacant for more than a month.

Kellogg and his wife, Nicole, didn’t want to uproot their 9-year-old son, Max, but by the time the Kellogg family embraced on the court Tuesday night, there was nowhere else they wanted to be.

“It’s a tough business. You put your family through a lot,” said Kellogg, who led the Minutemen to the 2014 NCAA Tournament. “To leave your home and take on a new adventure, and move into New York City … this makes the travel and the journey really worth it.”

The Blackbirds were picked to finish sixth in the preseason poll, but have now won five straight games behind an improving defense, and fifth-year senior Joel Hernandez, who scored a game-high 32 points and was named tournament MVP.

Hernandez, who suffered a season-ending injury in the first game last season, showed unrivaled poise, alternating physicality, and finesse. He went 10-for-16 from the field, and added seven rebounds, three steals and two blocks.

With a loss, Hernandez’s career would have been over — a reality too disturbing to let happen.

“I was thinking about that coming into the game,” Hernandez said. “I wanted to make sure I left everything out on the floor. I didn’t want to have any regrets.”

Wagner (23-9) had been 16-0 at home this season, until suffering its second title-game loss in Staten Island in the past three years. The Seahawks, who will head to the NIT, still are searching for their first NCAA Tournament berth since 2003.

Despite dominating the league for more than two months, the Seahawks felt the pressure of having one game defining their season. They shot 30 percent from the field, while hitting 6-of-33 from 3-point range.

Wagner trailed 34-18 at halftime, and never recovered. The Seahawks’ leading scorers, Blake Francis, and JoJo Cooper, finished a combined 6-for-29, with Francis hitting just 2-of-13 3-point attempts.

“We couldn’t throw the ball in the ocean … and I think our guys started pressing a little bit,” Wagner coach Bashir Mason said. “I didn’t see this outcome. I tried to see this outcome, I tried to force myself to see that we could lose, and I just couldn’t see it.

“It’s extremely hard to win three games in March. It’s not even catching lightning in a bottle, it’s like catching lightning in your hand.”

The Seahawks revived the crowd that carried them all season upon cutting the deficit to seven with 5:21 remaining, but the Blackbirds quickly stopped the bleeding, and cancelled the celebration that seemed inevitable all season.

The buzzer sounded, and LIU fans stormed the court, twisting the blade into the rival borough.

Once again, Brooklyn was back on top.