MIAMI -- Goran Dragic had 21 points and eight assists, Wayne Ellington scored 18 off the bench and the Miami Heat overcame another triple-double from James Harden to beat the Houston Rockets 109-103 on Tuesday night.

Dion Waiters scored 17, Tyler Johnson had 16 and James Johnson added 15 for the Heat. Hassan Whiteside finished with 14 points and 15 rebounds.

Harden had 40 points, 12 rebounds and 10 assists for the Rockets (32-12), his 13th triple-double of the season. He shot 12 for 30 from the field and got his triple-double with an assist to Montrezl Harrell with 12.6 seconds left, an uncontested dunk with the Heat simply waiting for the clock to run out.

An 8-0 run midway through the fourth quarter put Miami up for good in a game that was back-and-forth for 42 minutes.

RAPTORS 119, NETS 109

NEW YORK -- DeMar DeRozan had 36 points and 11 rebounds, Cory Joseph scored a career-high 33 and Toronto beat free-falling Brooklyn.

Toronto won its fourth straight game and extended Brooklyn's losing streak to 11 in a row. The Nets have not won since Dec. 26.

Terrence Ross added 15 points for the Raptors, who opened the game with an 11-0 run but fell behind after the first quarter.

Brook Lopez had 28 points for the Nets.

MAVERICKS 99, BULLS 98

CHICAGO -- Wesley Matthews made a go-ahead 3-pointer from the wing with 12 seconds left, and Dallas beat Chicago for its first three-game winning streak of the season.

Six players scored in double figures for the Mavericks, including all five starters. Harrison Barnes had 20 points, Seth Curry added 18 and Dirk Nowitzki finished with 10 points and 10 rebounds.

Dallas trailed 98-96 after Jimmy Butler made a long jumper over Matthews with 23 seconds left, but Mavericks coach Rick Carlisle decided against a timeout and Deron Williams drove into the lane before kicking out to Matthews for the 3.

Chicago had one last chance, but Dwyane Wade missed a potential game-winning jumper from the corner on his 35th birthday as time expired.

Butler finished with 24 points, 12 assists and nine rebounds for the Bulls, who had won two in a row. Robin Lopez scored 21, and Wade had 17 on 8-for-21 shooting.