Jets linebacker Quincy Williams celebrates after an NFL game against the...

Jets linebacker Quincy Williams celebrates after an NFL game against the Bills on Sunday in East Rutherford, N.J. Credit: AP/John Minchillo

Zach Wilson quieted his critics, the defense was outstanding and the Jets played like a team that could be in meaningful games in January.

They captured their biggest and most impressive win in years on Sunday, beating the AFC East-leading Buffalo Bills, 20-17, at MetLife Stadium.

This was a statement victory for the Jets. They had been given little to no chance to beat Josh Allen and the Bills — the team many consider the best in the AFC and a top Super Bowl contender.

“I know a lot of people are going to be surprised,” Robert Saleh said. “I don’t think there’s a person surprised in the locker room. I don’t think there’s a guy in that locker room that didn’t think we could win.”

The Jets (6-3) haven’t made the postseason for 11 consecutive years, but they are positioning themselves to snap that skid. The way their defense plays, they have a chance to win most games. They moved within a half-game of the Bills (6-2), and after their bye week, they face a rematch against the Patriots on Nov. 20.

The Jets overcame a 14-3 deficit as Wilson — who threw three interceptions last week against New England — took care of the football and led a game-winning scoring drive in the fourth quarter. Greg Zuerlein kicked a 28-yard field goal with 1:43 left to give the Jets a 20-17 lead.

Their defense made it stick against the usually explosive Bills. The Jets stopped Allen on the final drive and ended the game with Wilson in victory formation, taking a knee.

“We expected to win this game,” Wilson said.

The Jets are 2-1 in the AFC East after going 0-12 in the previous two seasons. After their season-ending loss in Buffalo last year, Saleh said they have to close the gap, and they certainly have.

This was an unbelievable defensive performance. The Jets kept Allen from throwing a touchdown pass, limited the Bills to three points in the second half and held them 12 points below their season average.

“It’s tough to win when your quarterback plays like [expletive],” Allen said.

He was 18-for-34 for 205 yards, no touchdowns and two interceptions and was sacked five times, although he did rush for 86 yards and two touchdowns Stefon Diggs had five catches for 93 yards but was shut out in the second half.

Wilson showed more poise than last week, got rid of the ball quicker and didn’t force many throws. He was 18-for-25 for 154 yards, a touchdown and no interceptions. His 101.1 passer rating was far better than Allen’s 46.8.

Garrett Wilson caught eight passes for 92 yards and Michael Carter ran for 76 yards and a touchdown for the Jets.

“I’ll be lying if I said Buffalo, we didn’t have something for them,” Garrett Wilson said. “We wanted to come up and prove something this week. We did that. Huge win for us.”

The Jets started their final drive from their 4 with 7:53 remaining and the score 17-17. They marched down the field with Carter and James Robinson, who caught Wilson’s only touchdown pass, running the ball eight times to the Bills’ 18.

On third-and-5, Wilson threw his first and only pass of the drive, hitting Denzel Mims on a slant for a 12-yard gain to give the Jets a first down at the Bills’ 6 at the two-minute warning.

“When we needed a third-down conversion, Mims played big-boy ball on the slant,” Saleh said. “Zach delivered a strike.”

The Jets got to the 2, but Wilson was sacked on third-and-goal. Zuerlein’s 28-yard field goal gave the Jets the lead and capped a 13-play, 86-yard drive.

They needed their defense to make one more monumental stop. The Bills started their final drive on their 25 and out of timeouts — and ended up going backward.

Allen hit Diggs for a 26-yard pass on first down, but a holding penalty negated it. After Allen’s 18-yard pass to Gabe Davis made it second-and-2 from the 33, Bryce Huff made a huge play, getting a strip sack on Allen. Buffalo recovered it at the 14.

“When I first hit him, I was thinking, ‘Where’s the ball?’ ” Huff said. “My mindset after they recovered the ball was just line back up and get ready for the next play.”

Allen threw incomplete on third-and-21 from the 14 and again on fourth down as Sauce Gardner broke up a long pass intended for Davis. Gardner also intercepted Allen in the third quarter to set up a touchdown.

The third quarter was wild.

Trailing 14-10, the Jets had a good drive going to open the second half. They ran a fake punt on fourth down that kept the series alive and were at the Bills’ 19 when the game was delayed 12 minutes because of a SkyCam malfunction.

“It only happens to the Jets,” Saleh said.

When play resumed, the 14-play drive ended with Von Miller getting a strip sack of Wilson that A.J. Epenesa recovered. But Quinnen Williams sacked Allen on first down and Allen then was intercepted by Gardner, who returned it to the Bills’ 19.

“That was the perfect time, the perfect situation for me to do that,” Gardner said.

The Jets turned that takeaway into a touchdown. Wilson and Robinson hooked up for a 7-yard score four plays later to give them their first lead at 17-14.

“There wasn’t a coach or a person in that locker room who didn’t think we weren’t going to be able to get this one done,” Saleh said.

The gap has been closed.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME