Richardson hit four free throws in the final 2.1 seconds to clinch it, ending Miami's three-game skid. Detroit has dropped five in a row.
The Heat played without center Hassan Whiteside, who is second in the NBA in rebounding (14.6 per game) and blocked shots (2.75). Whiteside missed the game with an injured right knee.
Kelly Olynyk, filling Whiteside's spot on the floor, scored 10 of his 13 points in the second half. Goran Dragic had 21 points and 15-year veteran Dwyane Wade, playing his farewell NBA season, contributed 18 off the bench.
Andre Drummond had 25 points for Detroit, and the NBA rebounding leader pulled down a game-high 24 boards. Reggie Jackson scored 25 and Langston Galloway added 21 off the bench.
Blake Griffin, second in the league in scoring, had 24 points before fouling out in the fourth quarter.
Miami used a strong third quarter to take control of a game that was tied 53-all at halftime, carrying an 87-80 advantage into the fourth quarter — a lead the Heat increased to 12.
The Pistons clawed their way back into it, and after Wade missed two free throws with 19.5 seconds to play and the Heat ahead 105-103, Detroit sent the game to overtime on a putback by Drummond with 0.5 seconds left on the clock.
Heat: It was Miami's first victory in Detroit's new Little Caesars Arena, which opened last season. Wade and forward Udonis Haslem were both part of the Heat team that beat the Pistons in the 2006 Eastern Conference final. Heat forward James Johnson (sports hernia surgery) and guard Dion Waiters (left ankle surgery) have yet to play this season.
Pistons: G Reggie Bullock missed his second straight game with an ankle sprain. G Luke Kennard (right shoulder separation) sat out his fifth successive game. Griffin and Milwaukee guard Giannis Antetokounmpo are the only NBA players averaging at least 25 points, 10 rebounds and four assists. Pistons rookie guard Bruce Brown, who made his third start of the season, played college ball at Miami.
Heat: Home against San Antonio on Wednesday night.
Pistons: At Orlando on Wednesday night.