Finally, the Rockets got the defensive stop they could not waste on the other end.

They had gotten a few at the end of regulation, but clanged away those chances by missing three free throws in the final minute. They led by five points with 2:40 left in overtime, but missed five straight jumpers, keeping the Orlando Magic in the game.

With that, Dwight Howard, who had stepped up in so many ways down the stretch, did one more time. He trapped Shabazz Napier into a turnover so that even after Ty Lawson missed on the baseline, the Magic had time left only for Napier to try a rushed 3-pointer that bounced away as the Rockets held on to win 119-114 on Wednesday night at Toyota Center.

James Harden grabbed the rebound of Napier’s miss with nine-tenths of a second left, and he made both free throws to give him 28 points. But Harden made just 6 of 22 shots, 2 of 11 3-pointers. He had banked in an 18-footer with 2:40 remaining and added a free throw for a five-point lead. But the Rockets did not score again until his free throws in the final second.

Howard propped up the Rockets through much of the fourth quarter. He finished with 23 points and 14 rebounds, making all 10 of his shots.

He appeared to have secured the win long before he and Lawson double-teamed Napier into his late turnover.

The Rockets were not down to their last chance. But even in a one-point game, they seemed to be heading rapidly in that direction.

They had three empty crunch-time possessions, with Harden turning the ball over on a long pass and then airballing a 3, before Lawson put up a 32-footer to beat the shot clock.