It took overtime, and some questionable officiating, but the New York Knicks snapped their six-game losing streak, and ended the Magic's five-game winning streak, with a 113-106 victory at Madison Square Garden.

Carmelo Anthony scored a game-high 39 points, and contributed a team-high 10 rebounds in the hard-fought victory.

It was fitting that the game would go to overtime considering neither team was able to build a lead larger than seven.

The Magic came undone on a questionable loose-ball foul by Dwight Howard that was the All-Star's sixth to foul him out of the game. That also led to a technical foul from Howard who voiced his displeasure with the call.

Chauncey Billups hit the subsequent free throw.

Moments later, Jason Richardson, who sent the game into overtime with a three-pointer, got tangled up with Anthony on the floor. After Anthony appeared to shove him, Richardson was whistled for a foul for tripping Anthony as the Knick forward made his way up the court.

The Knicks were able to escape thanks to taking a four-point lead after an Anthony foul shot in the closing seconds. Billups's technical foul shot and the following four-for-six free throws the Knicks converted in the final minute sealed the victory for New York.

The Magic were led by Howard's 29 points, and 18 rebounds. Orlando also got a 24-point performance by Richardson.

Knicks' big man Amare Stoudemire scored 20 points and added nine rebounds.