New York kicked off a five-game Western Conference road trip by completing a season sweep of Sacramento.
Anthony became the 29th player in NBA history to reach 23,000 points. He topped 30 for the fifth time this season and finished the night with 23,024 for his career.
Cousins' shot from the Kings' side of the court as the final buzzer sounded clanked off the front rim.
Cousins also missed a layup that proved costly. With the Kings down 99-98, he got a step on Knicks center Kristaps Pronzingis but clanked the layup with 21 seconds left.
New York's Brandon Jennings then made two free throws on the other end after a foul by Darren Collison. Cousins made a layup, but Anthony converted after a foul by Omri Casspi and the Knicks emerged with its fifth win in six games and eighth in the past 11.
Anthony scored 23 points in the opening half and 15 in the first quarter for the Knicks, drilling 6 of 8 shots from in the opening quarter.
Porzingis scored seven of his 17 points in the fourth quarter and led a 11-4 run that put New York ahead 89-84 with 7:37 left.
Collison finished with 14 points and stepped back to nail a 3-pointer to tie the score 92-92, then added a layup after a steal for a two-point Sacramento lead.
But Courtney Lee came down and drilled a 3-pointer to give for a 95-94 lead.
Rudy Gay finished with 13 points but missed an open 3-pointer with three seconds left that would have tied the score. Casspi scored 12 points, and Ben McLemore and Anthony Tolliver had 10 apiece for the Kings.
NOTES: Knicks G Derrick Rose is expected to return to the Knicks' lineup on Sunday when they face the Los Angeles Lakers. Rose has missed two straight games after playing in New York's first 22. ... Kings coach Dave Joerger said he rested F Matt Barnes because it was a scheduled night off, not for reasons tied to a report in the New York Daily News that stated Barnes' arrest on suspicion of misdemeanor assault is imminent. Barnes and C DeMarcus Cousins were investigated after an altercation at a New York City nightclub early Monday. The paper reported Cousins is not expected to be charged. Barnes played Sacramento's first 21 games, and Joerger said he would've rested Barnes in Dallas on Wednesday but didn't want to create the perception Barnes was being disciplined. ... New York does not play any back-to-back games on its current five-game Western Conference road trip, the first time that has happened for the Knicks on a trip this long since late in the 2009-10 season. ... The NBA denied Toronto's protest of Sacramento's buzzer-beater-defying 102-99 win over the Raptors on Nov. 20. A 3-pointer by Raptors G Terrence Ross that would have tied the score appeared to beat the buzzer, but referees reviewed the play and denied the three.