Amare Stoudemire added 20 points and 10 rebounds, and rookie Josh Harrellson contributed 13 desperately needed points from the bench as the Knicks won their fourth in a row and improved to two games over .500 for the first time this season.
Andre Iguodala and Evan Turner each scored 16 points for the 76ers, who were playing from behind nearly the entire way while trying to become the second team this season to win three games in three nights. They had been outscoring opponents by 16 points per game during their 7-2 start, but they trailed by as many as 17 in this one.
Still, the Knicks could never put it away until Anthony's free throws with 16 seconds left. They have now beaten the 76ers six of the last eight times after losing the previous six. New York visits Memphis on Thursday night.
Jrue Holiday scored 13 points and Thaddeus Young had 12 for the Sixers, who played without starting center Spencer Hawes, who strained his lower back Tuesday night and shot just 39.5 percent from the field
Anthony shot only 9 of 24 as the Knicks' offense continued to struggle, but he scored 12 points in the third quarter, providing the Knicks breathing room they would turn out to need when they went cold down the stretch.
The Knicks got only three points from their bench Monday in a victory over Charlotte, and coach Mike D'Antoni joked before the game that "we're going for five tonight." Harrellson, a second-rounder from Kentucky, bettered that by himself with seven points in the first quarter.
The Knicks jumped to a 28-15 lead, shooting 57 percent and holding the Sixers to 32 percent. Toney Douglas' 3-pointer to open the second extended the league to 16, but the Knicks stalled from there, and the lead was down to 45-35 at halftime after Iguodala's powerful drive and dunk with 35 seconds left.
The lead was trimmed to four during a chippy third quarter before Anthony accounted for all the points in a 7-0 burst to end the period, making a jumper and two free throws before finding Harrellson for a 3-pointer with 2.3 seconds remaining
Philadelphia coach Doug Collins said before the game he felt like a baseball manager, with a game seemingly every night, and it seemed to take a toll on his team. The 76ers repeatedly left Harrellson plenty of room, showing either a lack of respect for his shot or lack of commitment to getting out and contesting it.
The Sixers eventually showed plenty of fight, with Tony Battie getting a flagrant foul for whacking Tyson Chandler in the face in the third quarter and Iguodala and Anthony drawing double technical fouls less than two minutes later when they got tangled after Anthony's follow shot.
And even when they seemed out of it down 17 with 9 minutes left, they promptly rattled off 10 in a row, and later got within four in the final minute.
NOTES: The division rivals play only three times this season, here again on March 11 and at Philadelphia on March 21. ... Collins said he worked out Chandler three times before the 2001 draft when he was coaching the Washington Wizards. The Wizards took Kwame Brown with the No. 1 pick, while Chandler went next to the Los Angeles Clippers, who traded his rights to Chicago for Elton Brand. ... Oklahoma City is the only team to go 3-0 on a back-to-back-to-back.
Follow Brian Mahoney on Twitter: http://www.twitter.com/Briancmahoney