With point guard Jeremy Lin out with a bruised chest muscle, Patrick Beverley added 16 points for Houston.
The Rockets face a daunting bit of history: No NBA team has come back from a 3-0 deficit to win a best-of-seven playoff series. It's the first time in three chances that Houston has won a Game 4 when trailing 3-0 in a playoff series.
Game 5 is Wednesday in Oklahoma City.
"Getting this first win gives us confidence going back to Oklahoma City, and anything can happen," James Harden said.
The Rockets led in the fourth quarter of each of the last two games only to end up losing.
"We felt the pain and frustration from the last two losses ... and we didn't want that to happen for the third straight time," Parsons said.
It almost did.
Kevin Durant scored five quick points to cut the Rockets' lead to two. Harden missed two shots after that and the Thunder had a last chance. Reggie Jackson missed a jump shot and Serge Ibaka grabbed the rebound, but missed a layup at the buzzer.
A stunned Ibaka fell to the court after the miss and covered his face with his hands.
Durant scored 38 points in Oklahoma City's second game without injured All-Star guard Russell Westbrook.
The victory kept Houston from being swept in the playoffs for the first time since 1996.
"We're resilient and we're never going to give up no matter how much we're down in a game, how much we're down in a series," Parsons said. "No one's giving us a chance so we have no pressure. All the pressure is on them."
Durant hit the go-ahead 3-pointer in the Thunder's Game 3 win. He wanted to get another one off on Monday, but Francisco Garcia forced him to give up the ball.
"I was. I was going to try to win it," Durant said. "But he played good defense."
Durant is looking forward to the series shifting back to the Thunder's home court
"We'll be all right," he said. "We're up 3-1 with a good opportunity to close it out at home. We couldn't ask for a better situation, so hopefully we'll get the job done."
Harden scored 15 points, but also had franchise playoff-record 10 turnovers. He had two chances to extend Houston's lead with less than a minute left, but missed both of them, including shooting an air ball.
His 10 giveaways surpassed the nine turnovers Robert Reid had against Boston in 1980.
Getting the win allowed Harden to take his tough night in stride.
"I did have a double-double," he deadpanned, referring to his points and turnovers.
He picked up his fifth foul with about seven minutes remaining, sending him to the bench. A dunk by Jackson seconds later cut Houston's lead to 98-94.
Jackson got the Thunder within 100-98 with a 3-pointer a couple of minutes later. His 3-point attempt on the next trip down the floor rattled in and out of the basket.
Houston scored four quick points to extend the lead to 104-98 before Harden returned to the game with about three minutes left.
He said he struggled to get going after sitting out in the fourth quarter.
"The foul trouble kind of set me back," he said. "Coming in trying to make big shots, I was cold."
Rockets coach Kevin McHale was proud of his young team's work in getting its first playoff victory.
"That was a gutsy win," McHale said. "We're not going to lie down. The one constant has been their willingness to scrap and fight. We kept on fighting."
Derek Fisher made a 3-pointer to cut Houston's lead to 104-101 with less than three minutes remaining. It was reviewed a few seconds later and the points were taken away because replays showed the shot clock had expired.
Jackson finished with 18 points in his second start in place of Westbrook, and Kevin Martin added 16.
Houston got 17 points from Omer Asik and 13 from Carlos Delfino.
The Rockets scored the first 10 points of the second half to erase a halftime deficit and take a 63-60 lead. Parsons had six points in that span.
The Rockets did a much better job of keeping the crowd involved in this one than they did in Game 3, when they trailed early by as many as 26 points. Houston rallied to take a lead in the fourth quarter of that game before losing 104-101.
Near the end of the first half Durant sailed into the crowd Superman-style to save the ball on a bad pass from Harden. He was able to get to his feet and stood in the crowd watching as Martin swished a 3 on the other end. He couldn't figure out how to get out of the crowd for a few seconds before finally climbing out and back onto the court. But before he got back to the game Durant asked a woman in the first row who he crashed into if she was OK.
NOTES: Houston's Greg Smith returned Monday after missing Game 3 with a stomach ailment. ... Durant has scored 20 or more points in 30 straight playoff games. ... Former Rockets star Steve Francis watched the game from a courtside seat. ... The Seattle Supersonics were the last team to sweep Houston in the playoffs, getting a 4-0 series win in the Western Conference semifinals in 1996.