Carmelo Anthony fell and it was Amar’e Stoudemire who got up.

The Knicks rallied from a 22-point second quarter deficit to defeat the woeful Cleveland Cavaliers 102-97 despite Anthony injuring his right knee and spending the last 31 minutes in the locker room.

The extent of Anthony’s condition is unknown as he appeared to suffer the injury when he tripped over his feet. The Knicks outscored Cleveland 72-45 after Anthony left the game for good as Stoudemire exceeded his team imposed 30-minute time limit by scoring 22 points in a season-high 33 minutes.

Stoudemire made 10 of 15 shots as the Knicks bench scored 70 points, including 18 for J.R. Smith, 15 from Steve Novak and 12 from Jason Kidd. Not a single Knicks starter scored in double figures as Anthony scored a season-low six points in 14 minutes on 1-for-5 shooting.

The Knicks improved to 36-21 and won for the fourth time five games. Cleveland fell to 20-40.

Marreese Speights led the Cavs with 23 points but after making all 10 first half shots the veteran forward went 0-for-4 in the second half. Kyrie Irving, who had missed three previous games with a knee injury, scored 20 points on 9-for-20 and had hit potential game tying three-pointer blocked by Tyson Chandler with three seconds left.

The Cavs lead was 22 and with the Knicks showing no signs of life, Anthony’s stumble and fall could have been the final blow. The play started with Kidd rebounding CJ Miles’ errant 3-point shot and throwing an outlet pass to Anthony at midcourt.

No Cavaliers’ player was within 10 feet of Anthony, who fell as he went to catch the ball and turn toward the basket in one motion. He stayed down for a few seconds, before getting to his feet under his own power and walking to the locker room.