Dan Majerle added 22 points to Danilovic's 21 for the Heat, who increased their lead to three games over the Knicks in the Atlantic Division of the National Basketball Association in winning their seventh straight away game.
"We were humbled at home," said the Knicks coach, Jeff Van Gundy, whose team have won four and lost four at Madison Square Garden.
Danilovic, a 26-year-old Serbian in his second season with Miami, said: "I was just open tonight, they gave me the ball at the right time and I just made the shots. I am just playing the same game I always play."
It was first win at Madison Square Garden for the Heat coach, Pat Riley, since resigning as the Knicks coach in 1995. He was roundly booed, as he was last season when Miami lost twice in New York.
Allan Houston had 14 points and Larry Johnson and Patrick Ewing added 12 apiece for the Knicks, who never led. "Quite frankly, I just felt that tonight's game, we just didn't bring a competitive spirit," the Knicks forward Buck Williams said.
In Milwaukee, Michael Jordan scored 40 points and unheralded Jason Caffey inspired a pivotal fourth-quarter run with six points as the Chicago Bulls beat the Bucks 107-104. Jordan recorded his 148th career game of 40-plus points as the Bulls turned an 80-80 tie into a 14-point lead with four minutes to play.
In Los Angeles, Shaquille O'Neal scored 32 points, including four in the final 63 seconds, and had 14 rebounds to lead the Lakers to a 110- 106 win over the Seattle SuperSonics in a meeting of the Pacific Division's top two teams.
Nick Van Exel scored 16 of his 18 points in the second half, Byron Scott added 16 and Eddie Jones had 15 points, nine assists and seven rebounds for Los Angeles who moved within one game of Seattle at the top.Reuse content