Kobe Bryant added 21 points for the Lakers, who had a 15-game home win streak come to an end Tuesday after losing to the Hornets. Andrew Bynum provided 18 points and 11 rebounds, while Trevor Ariza had 17 points and nine rebounds for LA.
Sasha Vujacic posted 12 points and six assists, while Derek Fisher had nine points and eight assists in the victory.
Jamal Crawford led the Warriors with 25 points and nine assists, while Andris Biedrins nearly had a triple-double, with 12 points, 17 rebounds and eight assists in Golden State's first game since an 0-3 road trip.
Corey Maggette had 19 points, Kelenna Azubuike 15 and Marco Belinelli 14 in the loss for the Warriors.
The Warriors led by three at the outset of the fourth, but the Lakers used a 12-2 run to take a 102-91 lead on Gasol's basket with just under four minutes left.
Golden State responded with a run of its own, cutting its deficit to 104-101 on Crawford's basket that capped a 10-2 burst with 1:14 left.
The top sports headlines of the day
Vujacic hit a couple free throws to put the Lakers back up seven, but Belinelli drained a three to make it a four-point game.
Gasol answered with two free throws with 34.9 seconds to play, and Crawford's layup attempt was off the mark. LA made its free throws from there to seal the victory.
The Lakers closed the first quarter on a 9-0 run, and Bryant's basket late in the frame put the visitors up, 28-20, after the opening 12 minutes.
Golden State went on an 11-0 burst toward the end of the second to close to within two on Azubuike's three, and the Warriors trailed only 56-51 at halftime.
Both teams went back-and-forth in the third, and Crawford's basket with 3 1/2 minutes left put the Warriors up, 75-70. The Lakers came back to tie the game at 77, but Crawford hit three free throws in the waning seconds to give Golden State an 80-77 lead heading into the fourth.