Carmelo Anthony scored 24 points and the New York Knicks spoiled what might have been Kobe Bryant's last game at Madison Square Garden, beating the Los Angeles Lakers 99-95 on Sunday.