O'Neal had 31 points and 15 rebounds, both season highs, and the Heat earned their most impressive win yet since losing Dwyane Wade, edging Detroit 85-82 Friday night.
The Pistons rallied from a 50-28 deficit to take their first lead with 3:14 left. But O'Neal's dunk with 36 seconds to go put the Heat ahead to stay, 82-80.
Detroit missed three 3-point tries in the final 20 seconds that would have tied the game, including one by Chauncey Billups, who finished 2-for-14 from the field.
Antoine Walker scored 22 points for Miami. Tayshaun Prince had 22 and Richard Hamilton 20 for the Pistons, who failed to overcome a season-low 31 points in the first half.
The Heat improved to 3-2 since Wade was sidelined with a dislocated left shoulder. Detroit's Rasheed Wallace missed the game with a sprained left foot.