The Nets (40-34) looked like they might have been nursing a playoff-clinching hangover as the Knicks (33-43) outhustled, outshot and thoroughly outplayed Brooklyn to the delight of the packed Madison Square Garden crowd.
The victory lifted New York into a virtual tie with Atlanta (32-42) for the eighth and final Eastern Conference playoff berth as the Hawks fell 105-92 to the Chicago Bulls.
Brooklyn are already safely into the postseason and are still within reach of overtaking Toronto for the Atlantic Division title.
They lost ground with the loss to the Knicks as the Raptors (43-32) gained a game on them with a 107-103 win over Houston.
Both the Knicks and Nets overcame dreadful starts this season to become relevant teams down the stretch.
Brooklyn began 4-12, going through a difficult adjustment period with a host of new players and a first-time coach in former standout point guard Jason Kidd.
The Knicks started 4-13, and after a seven-game losing streak stood at a dismal 21-40 before their current desperate surge of 12 wins in 15 games that was launched by an eight-game winning streak.
"Anything is possible. I've never given up hope in our team," Knicks coach Mike Woodson said after the game.
"As a coach you just keep pushing buttons, trying to find the right buttons. And our players have responded. They want to get to the playoffs."
New York took charge with a 10-0 run to close out the first quarter with a 29-20 lead.
They built on their momentum by outscoring Brooklyn 10-2 at the start of the second quarter for a 17-point advantage that they built to 25 points by intermission.
Brooklyn cut the lead to 74-60 in the third but New York ran off eight points in a row at the end of the quarter to restore their cushion and coast on to victory.
JR Smith led the winners with 24 points, including 6-of-12 from beyond the three-point line, and Carmelo Anthony added 23 points and a game-high 10 rebounds as five Knicks scored in double figures and the team shot a red-hot 60 percent.
Guard Iman Shumpert came off the bench to provide some tough defense, registering five steals, and rookie guard Tim Hardaway Jr. scored 17 points on 7-for-10 shooting despite playing on a tightly taped right ankle he had sprained.
Joe Johnson led the sluggish Nets with 16 points.
"It happens. It is the schedule," coach Kidd said, referring to the back-to-back game for the Garden visitors that followed their win over the Rockets in Brooklyn.
"We played last night and we came out sluggish. You have to give New York credit ... they won the game."
Anthony said the effort the Knicks put forward after returning from a tough West Coast trip was a positive sign.
"It means a lot to know that we are in a dog fight coming towards the end of the season," the high-scoring forward said.
"Our backs are against the wall right now."
- Sports & Recreation
- New York