The Hornets snapped a four-game losing streak, overcoming a seven-point deficit midway through the final period.
New Orleans held Boston scoreless for the final 1:54 after Brandon Bass had given the Celtics a five-point lead with a follow shot.
New Orleans worked the ball to Eric Gordon for a drive and an attempt at a game-winning layup. That shot missed, but Davis was there to tip it home.
Anderson led the way for the Hornets with 21 points and Gordon had 18. Kevin Garnett, coming back from a two-game absence due to a thigh injury and flu-like symptoms, scored 20 points for Boston while Pierce had 28.
Boston was coming off a 105-103 loss to Miami, a game in which Jeff Green scored 43 points. Green had 13 against New Orleans.