There were hugs and handshakes all around. The Jets had waited a long time to enjoy a winning locker room. Four straight losses stretched over five weeks can take a toll on any team, and the Jets had grown weary of all the criticism hurled their way — “gag green” and all.

“Nobody counted on us to win that game,” Jets linebacker Jordan Jenkins said after the Jets beat the Cowboys 24-22 to capture their first victory with Adam Gase as their head coach. “Everybody bet on the Cowboys. They thought they were going to come here and we were going to get blown out. Stuff didn’t go our way in the past, but if we can keep working, we can shut everybody up.”

You can’t blame the Jets for the “us-against-the-world” mentality. It has been a long start to the season. And as happy as the Jets should be to finally get a win, it ultimately means little if it doesn’t serve as a good foundation for better things ahead.

“For us, the biggest thing we need to focus on is going back to work,” center Ryan Khalil said. “It was a great team win and we can go home and enjoy this one. But [Monday] we have to go back to work.”

Fact is, it would have been inexcusable if the Jets hadn’t beaten the Cowboys on Sunday at the Meadowlands. They probably should have beaten Dallas worse than they did. That it came down to denying a two-point conversion with 43 seconds remaining was more nerve-racking than it needed to be after the Jets claimed a 21-6 lead at halftime.

The Cowboys (3-3) entered the Meadowlands a wounded team and got more beaten up as the game progressed. They played without starting offensive tackles Tyron Smith and La’el Collins. Receiver Randall Cobb was inactive. Early in the first quarter, wide receiver Amari Cooper was lost with a quad injury, leaving quarterback Dak Prescott and running back Ezekiel Elliott to battle the Jets defense virtually on their own.

“It’s football. People get hurt,” said Elliott, who rushed for 105 yards on 28 carries and scored one touchdown. “We have to have the next-man-up mentality.”

It was a mismatch early, with the Jets using a goal-line stand and a 92-yard touchdown connection from quarterback Sam Darnold to wide receiver Robby Anderson to go up 14-3 before a 5-yard pass from Darnold to tight end Ryan Griffin made it 21-3 late in the second quarter. This was the Jets offense Darnold had talked about earlier in the year.

“It was amazing to have my brother back,” Anderson said. “It makes a big difference.”

Still, nothing comes easy for the Jets, which is why MetLife was left holding its collective breath as the Cowboys cut the Jets’ lead to 24-22 on a 4-yard TD run by Prescott with 43 seconds left in the game.

The Jets ruined the Cowboys’ two-point attempt to tie the game when safety Jamal Adams blitzed and pressured Prescott into a rushed throw toward tight end Jason Witten that fell incomplete. Finally, the Jets could celebrate.

“It was a big-time play,” defensive lineman Leonard Williams said. “We finished the game. Whether it was by one point or a bunch, we won the game and it was important to get it right now. Everyone had doubted us all season. We talked about it. Nobody has to believe in us besides ourselves. That’s what we said before the game. It held true. We won the game when everyone doubted us.”

This should be a start to making something positive of this Jets season. There’s a rematch with the Patriots set for next Monday night in the Meadowlands and with Darnold back, the Jets should have at least a puncher’s chance. The bigger picture is to keep improving to where finishing off wounded teams doesn’t have to come down to the final play.

“It’s just another steppingstone,” Adams said. “Everybody is counting us out, everybody didn’t have faith in us, including some of our fans. We just want to get that faith back into us. We just want to keep stacking the chips.”

That’s really what this season is finally about.