Reggie Jackson had 27 points for Detroit, which led by as many as nine points before dropping its third straight.
The Spurs were without Kawhi Leonard and Kyle Anderson, who has started in place of Leonard all season.
Rudy Gay, making his first start in place of Anderson, had 12 points, 10 rebounds and four assists. His final points came on a three-point play that gave San Antonio an 88-86 lead with 3:39 remaining.
Detroit trailed 94-93 when Gay failed to hit the rim on a 3-point attempt as the shot clock expired with 5.2 seconds remaining, but the Pistons' Tobias Harris committed a foul prior to the violation. Aldridge made two free throws to give the Spurs a 96-93 lead.
Gay blocked Harris' 3-point attempt at the buzzer to preserve the victory.
Pau Gasol added 15 points and 10 rebounds for the Spurs, who had seven players score in double figures and had three with double-doubles.
Andre Drummond finished with 11 points and 15 rebounds for his 17th double-double in Detroit's 23 games this season.
Jackson had 20 points in the first half and Detroit shot 48 percent against the league's second-best defense statistically through two quarters. The Spurs held the Pistons to 41 percent shooting to close the game.
Pistons: Drummond averaged 16 points and 16 rebounds against San Antonio last season. ... Detroit is 6-2 against Western Conference teams. . Stan Van Gundy has 498 career wins. . Jon Leuer missed the game with a sprained left ankle. . The Pistons have lost six straight to the Spurs.
Spurs: Leonard said prior to the game he is feeling healthy and will return "soon" from a quadriceps injury that has kept him out all season, but he does not have a target date for his debut. ... Patty Mills joined Ginobili and Matt Bonner as the only reserves in franchise history to make 500 3-pointers. ... Tony Parker and Ginobili have won 655 games as teammates, the fourth most among duos in league history. Utah's John Stockton and Karl Malone hold the record with 906 victories followed by Tim Duncan and Parker with 744 and Boston's Robert Parish and Kevin McHale with 656. ... The Spurs have made at least one 3-pointer in 999 straight games dating back to 2005.
Pistons: Visit Milwaukee on Wednesday night in their third game against the Bucks this season.
Spurs: Host Miami on Wednesday night in the second of a three-game homestand.