The Cavaliers ended their most recent losing streak at four games and won for just the 14th time in 71 contests this season.
Detroit closed within a point with 1:40 to go on a Chris Wilcox layup but the Pistons could not score again.
Gibson's jumper gave the Cavaliers a 94-91 lead with 1:27 to go and Baron Davis clinched the win by hitting a 3-pointer with 10 seconds remaining.
Detroit missed its last three shots, two of them from 3-point range.
J.J. Hickson scored 24 points and seized 15 rebounds for Cleveland. Davis added 16 points.
Richard Hamilton and Tayshaun had 15 points each for Detroit, which has lost three in a row.
Wisconsin business offering 'therapeutic cuddling' forced to close
Costly malfunction causes beer flood at Boston-area brewery