Knicks guard Jalen Brunson reacts in the second half of...

Knicks guard Jalen Brunson reacts in the second half of an NBA game against the Wizards at Madison Square Garden on Thursday. Credit: Kathleen Malone-Van Dyke

It almost happened.

The Knicks came precariously close to losing to a bad team they should have beaten easily, precariously close to ruining their perfect mark against teams with losing records.

Jalen Brunson, however, refused to let it happen.

The point guard again bailed out his team with a big-time performance, scoring 20 of his 41 points in the fourth quarter to carry the Knicks to a 113-109 win over the Washington Wizards on Thursday night at Madison Square Garden.

Brunson scored 11 straight Knicks points in a span of 3:26 as they outscored the Wizards 40-37 in the final quarter. He also had eight rebounds and eight assists in 40:21 despite playing the second game of a back-to-back after missing two games with a calf injury.

“They were just never going to quit,” said Brunson, who scored 30 points in a win over Houston on Wednesday night.

“We just found a way to win. I just found a way to get to the basket.”

Knicks fans responded with “MVP’’ chants in Brunson’s honor throughout the fourth quarter. That may be a stretch, but he is making a strong bid to play in his first All-Star Game next month in Indianapolis.

“He’s an All-Star. Just make sure he’s in Indiana or we’re going to riot a little bit,” said Isaiah Hartenstein, who had 17 rebounds. “We might have to all pull up to Indiana.”

The Knicks built an 84-75 lead on Precious Achiuwa’s dunk, but a pair of three-pointers by Landry Shamet quickly brought Washington within 84-83. That’s when Brunson began his run of 11 straight Knicks points.

Julius Randle’s putback gave the Knicks a 104-95 lead with 1:51 left, but Shamet’s 30-foot three-pointer with 5.2 seconds to play made it a two-point game. DiVincenzo sank two free throws with 3.7 seconds remaining to clinch it.

The Knicks (25-17) are 18-0 against losing teams and 8-2 since trading for OG Anunoby.

Randle scored 10 points in the first quarter and finished with 21. DiVincenzo, who hit five three-pointers, and Anunoby added 19 each, but the Knicks got only seven points in just under 42 minutes from their bench.

Washington was led by Jordan Poole’s 24 points. Marvin Bagley III added 20.

The Wizards, who now are tied for the second-worst record in the NBA at 7-33, were fresh off a loss to Detroit (4-37), the team with the worst record. This should have been an easy one. Instead, the Knicks had to take drastic measures to stay ahead.

With Josh Hart missing a game for the first time this season with a sore knee, they struggled to get anything out of their bench.

After the Knicks finished the first half with a one-point lead, Tom Thibodeau played four of his starters — Brunson, DiVincenzo, Randle and Hartenstein — the entire third quarter, with Quentin Grimes giving Anunoby a rest. Anunoby played 42:38, topping 40 minutes for the third time in four days.

Thibodeau was so desperate to find some firepower off the bench that he played Evan Fournier for only the third time this season.

Fournier, who was 0-for-4 in the first half, last played Dec. 30 when the Knicks were shorthanded after the trade with Toronto.

Perhaps the Knicks were looking ahead to Saturday’s game against the Raptors. Much to-do has been made of RJ Barrett’s and Immanuel Quickley’s first game at Madison Square Garden since the Knicks traded them for Anunoby, Achiuwa and Malachi Flynn on Dec. 30.

Said Thibodeau: “We didn’t play great tonight, obviously, but we found a way to win, which is the most important thing . . . That’s the bottom line.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME