Dwyane Wade returned from a seven-game absence to score 27 points — 13 in the fourth quarter — and the Miami Heat beat the New York Knicks 86-79 on Sunday night.

Chris Bosh added 20 for the Heat, including a crucial 3-pointer with 1:07 left as Miami held off a late New York rally.

Carmelo Anthony also returned after a two-game absence because of back spasms to score 31 points for the Knicks. Amare Stoudemire had 19 points and 12 rebounds

After trailing by as many as 16, the Knicks pulled to 65-63 on Tim Hardaway Jr.'s layup with 9:22 left.

Wade, sidelined since Nov. 12 by a hamstring injury, followed with a baseline jumper and scored 12 of Miami's next 15 points to help the Heat maintain the lead.

After the Knicks again pulled to 79-77 on Stoudemire's tip-in with 1:23 left, Bosh hit his 3-pointer and New York never got closer.

The Heat opened a 10-2 lead and never relinquished the advantage.

Miami took its biggest lead, 37-21, on Bosh's layup with 4:48 remaining in the first half. The Heat had led 21-17 after the first quarter before beginning the second on a 16-4 run.

Luol Deng had 10 points and 10 rebounds for the Heat. Bosh added nine rebounds.

Samuel Dalembert and Jose Calderon each had 10 rebounds for the Knicks.

TIP-INS

Heat: Miami has beaten the Knicks four straight. ... Bosh (4th) and Wade (5th) were selected directly behind Anthony (3rd) in the 2003 draft. ... The Heat were 3-4 during Wade's seven-game absence.

Knicks: New York last beat Miami on Jan. 9, 2014. Anthony had 29 points, eight rebounds, five assists and two steals in that 102-92 victory. ... New York has lost four straight, six of its last seven and 13 of its last 15. ... The Knicks' 34 halftime points were one more than the season-low 33 they scored in their previous game against Oklahoma City on Friday night.

UP NEXT

Heat: At Washington on Monday night.

Knicks: Hosts Brooklyn at Tuesday night.