Knicks center Karl-Anthony Towns reacts in the second half of...

Knicks center Karl-Anthony Towns reacts in the second half of an NBA game against the Nets at Madison Square Garden on Sunday. Credit: Kathleen Malone-Van Dyke

This time the Knicks didn’t let go of a third-quarter lead over the Nets.

After nearly collapsing Friday night before eking out a late-second win, the Knicks kept their feet on the gas and defeated the Nets, 114-104, for the second time in three days at Madison Square Garden.

Sunday’s win showed the impact of Karl-Anthony Towns, who missed the first meeting with a knee injury. Towns had 26 points, 15 rebounds and six assists in 29:55 to lead the Knicks (7-6).

Only foul trouble slowed down the big man, wo picked up his fifth with 7:20 remaining. He didn’t return to action but it didn’t matter as his teammates picked up the slack.

OG Anunoby had 24 points and eight rebounds. Mikal Bridges added 21 points in his third consecutive game with at least 20. Josh Hart had 20 points, eight rebounds and eight assists.

It overshadowed a quiet night from Jalen Brunson, who scored 37 points on Friday. Brunson shot 3-for-14 and missed all five three-point attempts on Sunday but still finished with 10 assists, five rebounds and two steals to go with 12 points.

“It’s nice to have a good enough, talented team where we’re not just so reliant on [Brunson] scoring and creating and doing those kind of things,” Hart said.

“KAT can fill it out, OG, Mikal, Cam [Payne] with great energy off the bench.

“It’s not so much pressure to knock down shots and initiate everything. Sometimes he can take a couple breaths, couple of possessions and we can still hoop.”

Towns dominated in the third quarter with 14 points and solid defense. The Knicks rode his play to a 95-81 lead after outscoring the Nets 35-24 in the third.

It was similar to what he did in the second quarter after the Nets opened with a pair of free throws to take a 31-30 lead. Towns had five points and four rebounds in an 11-0 Knicks run that snatched back the lead. He added a three-pointer that made it 49-41.

With Deuce McBride (knee) out for the second consecutive game, Tom Thibodeau shortened his rotation to eight players. Ariel Hukporti, who played 30 minutes Friday, did not play, and Hart and Bridges played 46:05 and 44:57, respectively. Anunoby was in for 40:22.

The Nets (5-9) withered in the second half, particularly during a rough third quarter. They had six turnovers that led to nine Knicks points, with Ben Simmons contributing three of them. Simmons was scoreless with eight assists.

Cam Thomas scored only 16 points after his 43-point outburst Friday. The Knicks double-teamed him often and Thomas shot 4-for-11 from the field.

“I thought [Thomas] did a good job getting rid of the ball, getting good shots,” coach Jordi Fernandez said.

“We just were not able to get stops. Basically, that was the main reason, because if you get a few stops and start running, that’s how you make runs. I think it was a big difference-maker right there. We could not defend enough in this game to get the win.”

The Knicks shot 48.9% after shooting 53.5% in the first half.

The Nets, who have lost five of their last six games, made 17 three-pointers, and it kept them close. They struggled to finish at the rim, shooting 9-for-20. Towns took advantage of the Nets not having injured centers Nic Claxton and Day’Ron Sharpe.

“Obviously, it was a part of it,” Simmons said about the lack of paint scoring. “Definitely a problem. But yeah, I just don’t think we brought energy tonight. Yeah. We didn’t play how we needed to play.”

Cam Johnson had 22 points, his fifth game this season with at least 20. Dorian Finney-Smith added 16 and Jalen Wilson scored 15 off the bench.

Trendon Watford made his season debut for the Nets after being sidelined since training camp with a strained left hamstring. He played 13:26 and had four points, three rebounds and three assists.

But the night belonged to the Knicks, who have won eight consecutive games against their crosstown rivals. More than that, they showed signs of jelling with and without Towns and without Brunson having his usual scoring flourish.