The New York Knicks went to their defense and their big guns when the going got tough to pull off an ugly 91-84 win Monday at The Garden.

Struggling all game long, Julius Randle picked the right time to come alive.

Randle pumped in seven points and pulled two huge rebounds inside the final 1:33 that carried the Knicks to their second straight win.

The Knicks moved up to 7-8, a big turnaround from last season. It took them 28 games to reach seventh win last year.

But it wasn’t easy. The Knicks showed tremendous growth and a lot of fight to pull off the close win.

“It was a tough one for us. It’s tough to have a back-to-back schedule. Two early games are even tougher. [Magic] were a good team. We stayed together. We get it done. We got the job done,” Randle said postgame.

Randle got the job done by continuing to make plays despite his worst shooting performance this season.

“When shots are not falling, you have to find another way to help the team,” Randle said.

“I stayed mentally strong the whole game. The body is fine. I had hard long summer to prepare for this.”

He was 5-for-19 from the field but still willed his way to a huge double-double of 21 points and 17 rebounds.

Barrett also had another strong performance coming away with 22 points, including a transition basket off a Magic turnover that gave the Knicks a four-point cushion down the stretch.

The sophomore wing added 10 rebounds, and four assists.

The Knicks nearly squandered a 14-point lead as the Magic got hot in the fourth quarter.

Immanuel Quickley scored 11 points off the bench but Elfrid Payton played solid (12 points and four assists) to earn the nod to close out the game. He was a team-high +/- 20 in this win.

“They [Knicks] showed a lot of toughness. I love the way we started the game and then we took the hit. But the ability to take the punch, get a hit and find a way to win is a great ability in the league,” Tom Thibodeau said.

The Knicks missed 10 free throws but made their last seven trips at the line to survive the Magic’s comeback.

Orlando took the lead briefly on a Terrence Ross’s magical heave with shot clock winding down. But they fell apart in front of the Knicks’ tenacious defense.

The Knicks held the Magic to 33.7 percent from the field. It marked the second straight game their defense held their opponents under 85 points and under 35 percent.

Nikola Vucevic paced the Magic who fell to their sixth straight loss with 24 points and 14 rebounds.

The Knicks will fly to the West Coast and play another back-to-back games against the Golden State Warriors on Thursday and the Sacramento Kings on Friday before closing out the tough week schedule in Portland on Sunday.

Follow this writer on Twitter: @alderalmo

More must-reads:

TODAY'S BEST
Watch: Phillies' Bryce Harper stays hot with another grand slam
Cardinals' Willson Contreras suffers broken arm after being hit by swing
Nuggets star gets fined, but avoids suspension for ugly Game 2 actions
PSG superstar to potentially depart club with zero UEFA Champions League trophies
NFL has a reported date for the 2024 schedule release
Knicks big man out for rest of playoffs
Lions sign veteran defensive tackle
Rudy Gobert's Defensive Player of the Year award redeems reputation of darkness retreats
Sharks win 2024 NHL Draft Lottery, get No. 1 pick for first time
John Calipari recruiting another top player from Kentucky
Astros GM makes revealing comments about team's trade-deadline strategy amid poor start
Giants designate right-hander for assignment
Former All-Star shares concerns of potential Knicks burnout
Chiefs' Rashee Rice reportedly under investigation for alleged assault
Ryan Garcia takes big step following positive drug test
Cowboys VP backs Dak Prescott despite lack of contract extension
Cubs get major boost to lineup as former MVP returns from IL
Ohio State tops analyst's college football post-spring Top 25
Lions bringing back safety after gambling suspension
Tyler Boyd signs with AFC team