Kevin Durant top scored for the Thunder with 27 points while Russell Westbrook provided a further 23, as the Thunder took a 3-2 lead in the best-of-seven Western Conference Finals series.
James Harden added 20 for Oklahoma City, who condemned the Spurs to a third straight defeat after having won the opening two games of the series, part of a 20-game winning streak.
The youthful Thunder led at each break and by as many as 14 points during the second quarter before the Spurs clawed back.
Down by 13 late in the final quarter, San Antonio plundered 11 unanswered points to draw within two, only to see Westbrook snap the streak with a clutch basket in the final minute.
James Harden then sucked the life out the Spurs with a great three-pointer over the top of rookie Kawhi Leonard with just 28 seconds left.
"The ball was supposed to go to Kevin (Durant) but the shot clock was running down and I had to make a play," Harden said.
"Leonard was playing very good defence on me but I thought I'd shoot it with confidence and it went in."
Thunder coach Scott Brooks was full of praise for his team despite watching them almost throw away the victory.
"I thought that was a total team effort," Brooks said.
"We stuck together and we had couple of bad stretches but didn't break, we battled through that.
"Everybody did their job, we played about as hard as we could play."
Spurs coach Gregg Popovich tried to spark his offence by starting regular sixth man Manu Ginobili for Danny Green but despite a game-high 34 points it wasn't enough.
The home side had 21 turnovers throughout the game with Westbrook adding four steals and Durant three to their impressive points tallies.
"It's not like we're playing the sisters of the poor," Popovich said of the Thunder.
"These guys are hungry, athletic, they are a very good side.
"Championship teams win on the road. Oklahoma City just did that."
The series continues in Oklahoma City with Game Six on Wednesday.