Boston (35-41) moved into a tie with New York for seventh place in the Eastern Conference.
Pierce sank a 19-foot jumper with 46 seconds left as part of a 32-point effort to give Boston the lead for good at 108-106. After Jiri Welsch knocked the ball away from Avery Johnson on the next possession, Pierce sank two free throws to seal the victory.
The Celtics had a 62-48 halftime lead, but the Warriors opened the third quarter with a 16-6 run to get back in the game.
Marcus Banks kept Boston on top by making a career-high seven steals in 17 minutes off the bench. He also scored 13 points, keying an 11-0 run that bridged the third and fourth quarters.