The Rockets were up by six when Nene made a layup before intercepting a bad pass by James. Patrick Beverley made a 3-pointer on the other end to push the lead to 116-107 with less than two minutes left.
Kyrie Irving hit a 3 with less than a minute to go and added two free throws after that to get the Cavaliers within four. But then Harden sank a free throw to end Cleveland’s run and secure the victory.
It was the 16th triple-double this season for Harden and his 31st game with at least 30 points.
James had 30 points and Irving scored 28 for the Cavaliers, who lost for the fourth time in five games.
Deron Williams gave the Cavaliers a one-point lead on a 3 with about seven minutes left before Houston scored the next seven points, highlighted by Clint Capela’s two-handed dunk on an assist from Harden to make it 107-101.
James ended a scoring drought of almost two minutes when he drained a 3-pointer just before the shot clock expired to get Cleveland within three.
Lou Williams gave Houston a six-point lead by opening the fourth quarter with a layup. Cleveland then used a 10-2 run, with 3s from James and Channing Frye, to go on top 96-94.
Cleveland led by 14 with about 10 minutes left in the third quarter after a 3-pointer by James. The Rockets then used an 18-7 run to get to 81-78 with less than four minutes left in the period. Houston had two 3-pointers in that span, one from Harden and one from Ryan Anderson.
Harden and James both added a basket after that before Houston missed six straight shots over the next two possessions.
Lou Williams finally got the Rockets going again when he made a 3-pointer that tied it at 83 with about two minutes left in the quarter.
The Cavaliers regained the lead with a 3 by Derrick Williams, but Houston scored the last seven points of the quarter to take a 90-86 lead into the fourth. Harden capped that run by grabbing a steal from Irving and finishing on the other end with a layup.
The Cavaliers led 67-58 at halftime.