Harden also had five steals and a block as Houston extended its winning streak to four games.
LeBron James had 33 points for the Cavaliers, and Jeff Green added 27.
Houston led by seven after a layup by James with about 10 minutes left. The Rockets scored the next six points, capped by a 3-pointer by P.J. Tucker to make it 111-98. The Cavaliers used a 13-1 run, with five points from James, to cut the lead to 112-111 with 90 seconds left.
Harden missed a layup after that, but grabbed a rebound and threw an alley-oop to Clint Capela, who finished for Houston’s first basket since Tucker’s 3. He was fouled on the play and made the free throw to make it 115-11 with just over a minute remaining.
James made a layup on the other end, but Capela made another basket after a grabbing the rebound on a miss by Harden to put Houston back up by 4 with 10.7 seconds left.
Capela, who finished with 19 points, 13 rebounds and four blocks, blocked a shot by James in the final seconds to secure the win.
Harden has scored 30 or more points in three of the last four games, highlighted by a 56-point performance in a win over the Jazz on Sunday. It’s the second triple-double of the season for Harden and the 33rd of his career.
The Rockets made the first seven points of the second half thanks to a three-pointer by Eric Gordon and a four-point play by Trevor Ariza to take a 72-67 lead.
Cleveland got going soon after that and a layup by Iman Shumpert got the Cavaliers within 1 point soon after that. But Harden made two 3-pointers to power an 8-2 run that extended Houston’s lead to 81-74 lead with about 7 1/2 minutes left in the quarter.
The Cavaliers scored five quick points, capped by a 3-pointer by Green, to tie it at 87-87 about three minutes later. A 3-point play by Gordon put Houston back on top and the Rockets had extended their lead to 100-93 entering the fourth quarter.
The Rockets led by as many as 18 in the first half, but the Cavaliers made a big run in the second quarter to take the lead. Harden made a pair of free throws in the final seconds of the half cut Cleveland’s lead to 67-65 at halftime.
Cavaliers: G Derrick Rose sat out because of soreness in his left ankle. Rose missed four straight games after spraining his ankle on Oct. 20 before returning to play the last two. But the ankle was still bothering him, forcing him to sit out again on Thursday night. … Shumpert started in his place and finished with seven points. .. Love had 17 points before fouling out in the fourth quarter.
Rockets: F Luc Mbah a Moute missed because of a bruised left knee. … Gordon added 20 points. … Harden made 13 of 14 free throws.