Devin Vassell scored 21 points and De'Aaron Fox added 20 for the Spurs, who overcame a lackluster night from superstar Victor Wembanyama to push their win streak to double digits for the first time since the 2015-16 season.
The French big man connected on just three of 12 shots on the way to 12 points in the face of a determined Raptors defense.
But Wembanyama was five-for-six from the free-throw line, and his five blocks included a crucial denial of Jakob Poeltl with 44 seconds remaining.
The Spurs improved to 42-16, just two games behind Oklahoma City, who fell to 45-15 after their 124-116 loss to the Pistons in Detroit.
Cade Cunningham and Jalen Duren scored 29 points apiece to lead the Pistons in a battle of conference leaders touted as a possible NBA Finals preview.
The clash lost some luster with Oklahoma City's reigning NBA Most Valuable Player Shai Gilgeous-Alexander headlining a raft of Thunder absentees as he missed a ninth straight game with an abdominal strain.
Isaiah Hartenstein, Chet Holmgren, Ajay Mitchell and Jalen Williams were also sidelined, and Isaiah Joe departed at halftime with a bruised hip.
The depleted Thunder led 34-22 after a tight first quarter, but the Pistons out-scored them 36-18 in the second period to seize control and never trailed in the second half.
Duren added 15 rebounds for his 27th double-double of the season. Cunningham handed out 13 assists for Eastern Conference leaders Detroit, who saw a 17-point lead whittled to four with 39.2 seconds left.
Cunningham found Duren for a dunk and Cunningham then drained a pair of free throws as the Pistons held on.
In Milwaukee, the Bucks shook off the continued absence of superstar Giannis Antetokounmpo to beat the Cleveland Cavaliers 118-116.
Jarrett Allen scored 27 points and pulled down 11 rebounds for Cleveland, but his last-gasp effort that would have forced overtime was ruled to have left his hand after the buzzer.
The Cavs were without star guard James Harden, who suffered a broken thumb in a win over the New York Knicks on Tuesday.
Harden, who arrived in a trade from the LA Clippers this month, was listed as "questionable" up until game time, but joined Donovan Mitchell and Evan Mobley on the sidelines.
With Antetokounmpo missing a 13th straight game with a calf injury, Kevin Porter Jr. led the Bucks with 20 points, delivering the game-winner with 20.2 seconds left after Dennis Schroder had tied it with 35.6 seconds to play.
