NBA

Knicks outlast Mavericks to remain NBA’s only unbeaten team

BIG SCORE: Carmelo Anthony drives to the hoop to score two of his 31 points during the Knicks’ 104-94 victory over the Mavericks last night at the Garden.

BIG SCORE: Carmelo Anthony drives to the hoop to score two of his 31 points during the Knicks’ 104-94 victory over the Mavericks last night at the Garden. (REUTERS)

The Knicks sweated it out for a half, which is the most they have sweated this season.

After falling behind at halftime and actually looking beatable, the Knicks swatted their first challenge away with the ease of the NBA’s lone undefeated team.

Holding the Mavericks to 37 points in the second half, the Knicks romped to 4-0 for the first time since 1993-94, posting a 104-94 Garden victory over the Mavericks. It was their fourth straight double-digit win to start the season — a franchise record.

Carmelo Anthony had 31 points, seven rebounds and two first-half blocks despite being in foul trouble and center Tyson Chandler, a beast on both ends, ransacked his former club with 11 points and nine rebounds.

Chandler won a championship in Dallas and the 4-0 start has him thinking title here.

“It definitely reminds me of [Dallas],’’ Chandler said. “The chemistry, personalities, personnel. We were a team that came at you in waves. Same thing here.’’

Anthony penetrated to the hole all night and hit 10 of 22 buckets. But his biggest basket came out on the perimeter. In what coach Mike Woodson called the game’s biggest shot, Anthony drained a left-corner 3-pointer with 7:05 left, turned to the heckling Dallas bench, as the Knicks lead swelled to 93-86.

“Everybody wants to trash-talk to me,’’ Anthony said. “One of those moments in the game you know some things are going back and forth.’’

“The message of the night is we’re going to have ugly games like this and we’re going to have to learn how to win them.’’

The Knicks trailed 57-55 at halftime, with the Mavericks shredding the Knicks’ league-leading defense for 34 second-quarter points. Dallas connected on 7 of 15 3-pointers and O.J. Mayo (23 points) did his damage.

Chandler delivered an urgent halftime message.

“We talked about not coming back in this locker room and feeling like we let one get away and played like it in the third quarter,’’ he said.

It was sweet revenge for Chandler and guard Jason Kidd, who teamed to win a 2011 title. Kidd had six points, three steals and three assists in 15:28. Kidd’s steal and feed early in the third quarter for a Raymond Felton fastbreak bucket helped turn the momentum. That put the Knicks up one with 9:00 left in the period — their first lead since the opening seconds of the second period.

Chandler delivered the knockout blow with 5:30 left on a ferocious putback dunk. He soared over Elton Brand, ripped the ball from Jae Crowder above the rim and slammed it down and got fouled. He embarked on a wild celebration near the Dallas bench, roaring, swinging his arms and pounding his chest. He made the free throw for an 11-point lead.

“I just wanted to give my guys some energy,’’ Chandler said of his outburst. “We let them hang around and that can bite you in the end. I wanted us to put it away.’’

Kidd said beating Dallas wasn’t as special as going 4-0.

“No matter who the opponent, we had to come out and keep the momentum going,’’ Kidd said. “We were a little flat early. But for me, it doesn’t have to be about scoring.’’

Knicks backup center Marcus Camby made his season debut and played just 8:02, collecting four rebounds. But Camby’s presence and an increase of minutes for Rasheed Wallace (17:20) meant no minutes for Kurt Thomas.

With Anthony on the bench in foul trouble in the third quarter, the Knicks took control, with sixth man J.R. Smith (22 points) giving them the boost. After Anthony left with four fouls with 7:30 left, Smith drained a left-corner 3-pointer for a 72-65 lead with 5:13 to go, then buried a pull-up 15-footer.

Then the Knicks newly trademark defense stiffened.

“We’ve had four straight games no one has scored over 40 points in the second half,’’ coach Mike Woodson said. “That’s locking in and taking pride in defending the ball.’’