Tyson Chandler's arms reached above everyone else's inside the paint after Carmelo Anthony's layup rimmed off. In one motion, Chandler grabbed the ball, got hit on the arm and slammed home the miss as the Garden erupted with noise midway through the fourth quarter.

Chandler was loud himself, screaming toward the Mavericks' bench and flexing after J.R. Smith gave him a chest bump. Chandler then high-fived some fans sitting courtside.

Chandler probably had some extra emotion because he was playing against his old team and the Knicks were in a battle for the first time this season. They prevailed, beating the Dallas Mavericks, 104-94, Friday night to remain the NBA's only unbeaten team.

"I just wanted to give my guys some energy," Chandler said. "I felt like we were a little flat-footed. This was one of those setup games where you let teams stay around and they bite you in the end."

The Knicks are 4-0 for the first time since 1993-94, when they reached the NBA Finals. They have won the first four games by double figures for the first time in franchise history.

Anthony led the Knicks with 31 points, nine in the fourth quarter. Smith provided a spark off the bench, scoring 22 points, including nine in the third after Anthony went to the bench with four fouls. Chandler had 11 points and nine rebounds. His follow dunk and three-point play put the Knicks up 96-86 with 6:08 left.

"They are a very good team," Mavs coach Rick Carlisle said. "They are one of a handful of teams . . . that have a chance to come out of the East."

The Knicks hadn't played since Monday and definitely weren't as sharp as in their first three games. The Knicks hadn't trailed beyond the first quarter in any game. But they were challenged by the Mavs, even with Dirk Nowitzki sidelined, and were down in the third quarter.

After Chandler tried to motivate his teammates at halftime, the Knicks, who were down nine in the second quarter, held Dallas to 37 second-half points, only 16 in the fourth quarter.

"We wanted it," Chandler said. "We didn't want to have a letdown. We talked about that in the locker room [at halftime], that we're not going to come back into the locker room disappointed and feeling like we let one get away."

After O.J. Mayo scored inside with 7:32 left to make it 90-86, Chandler and Raymond Felton grabbed offensive rebounds. Felton fed Anthony for a corner three that he hit to put the Knicks up seven.

Anthony turned and said something to the Mavericks' bench. He said they were talking trash throughout, and Anthony was involved in some physical play with Dahntay Jones.

"Everybody, they want to trash-talk to me, to Melo," Anthony said. "It's all fun at the end of the day."

"We're going to have games like this," Anthony said. "There's going to be ugly games, ugly wins. We've got to learn how to win, and tonight was a good test."

Notes & quotes: Before the game, Mavs owner Mark Cuban joked that he would "boo" Jason Kidd and "do it with a lot of warmth." He said Kidd, who left Dallas to sign with the Knicks, still is on his "Christmas card list, but I won't call him to see how the kids are." . . . Marcus Camby made his season debut and had two points and four rebounds in eight minutes.