They were getting heavily outshot, smothered in the offensive zone and their power play couldn’t generate. But they needed a win in regulation and somehow got it.

The Avalanche traveled to Vegas for their biggest regular-season game of the season on Monday and escaped with two points, defeating the Golden Knights 2-1 at T-Mobile Arena. Colorado was outshot 37-21, including 23-12 in the final two periods, where it outscored the Knights 2-0.

Avs goalie Philipp Grubauer made 36 saves to earn his 29th victory in what was arguably his best performance this season.

“Simple. Goaltending,” Avs coach Jared Bednar said when asked how his team managed to squeak out the victory. “That was it. Without him, we don’t have any chance in this one.”

Playing with just 15 skaters, the Golden Knights suffocated the Avs’ offense, oftentimes double or even triple-teaming top stars Nathan MacKinnon and Mikko Rantanen. Colorado was 0-for-2 on the power-play, generating just one shot compared to Vegas’ 11 on its unsuccessful three opportunities.

Winning in regulation was crucial. The Avalanche now trail the Golden Knights by two points with a game in hand heading into the final two games. By keeping Vegas from collecting a point, Colorado now controls its own destiny in winning both the West Division and the Presidents’ Trophy.

With a sweep of the Los Angeles Kings at Ball Arena on Wednesday and Thursday, the Avs will clinch the division and the trophy.

It’s possible for the Avs to still win both without going 2-0. But that would require help from San Jose, which hosts the Golden Knights in the finale for both teams. Vegas is 7-0 against the Sharks.

The Avs could also drop to third place if they go 0-2 and the Minnesota Wild go 2-0 to close out their season.

“It doesn’t matter if you don’t win the next one,” Grubauer said of winning in regulation. “L.A., they’ve got nothing to lose. We got to find a way to play our game again, get ready for the next two and we’ll see who we’re going to play.”

Colorado trailed 1-0 before mounting what seemed like an insurmountable comeback at times. It was physically outmatched, despite outhitting the Knights.

Bednar called Vegas the more physically dominant team, adding, “we outhit them 49-45 because they had the puck the whole night. We probably had three times as much play without the puck so we had to try to check it back.”

But after an Andre Burakovsky goal tied the game in the second period — his fourth during a six-game point streak and 100th of his career — the Avs needed someone to step up in the third.

And J.T. Compher came through.

Compher skated the puck into the offensive zone before dropping it to young defenseman Conor Timmins. He then passed it to rookie Alex Newhook who marvelously sneaked the pass to Compher in the crease for the goal. Compher snuck it through the five-hole of Vegas goalie Robin Lehner to put the Avs ahead.

It was just Compher’s seventh goal, but the biggest of the season thus far for Colorado, as the victory also snapped Vegas’ seven-game home winning streak.

“It was a great play by Timmy at the line and Newy to get it to the net. It felt good to get that one tonight,” Compher said.

It was Newhook’s second assist of the game and third of the season. The 20-year-old who signed his entry-level deal on March 30, was a plus-1 for the fourth consecutive game of his four-game NHL career.

Newhook started as the second-line center between Burakovsky and Nazem Kadri. But when Bednar made a bevy of lineup changes later in the game, he found himself playing with Compher and Tyson Jost.

“Newhook was playing well,” Bednar said. “I thought Compher was skating pretty well too so I elevated him from the fourth line to the third line just trying to get a spark because we didn’t have anything going for 40 minutes.”