Kobe Bryant had 29 points and 10 assists and hit the go-ahead three-pointer with 12 seconds remaining for the Lakers, but after a timeout the Spurs went ahead thanks to an incredible shot from Mason.
Matt Bonner barely beat the five-second count and inbounded the ball to Mason, who drew contact from Derek Fisher and hit the line drive shot from the left corner to the game at 111. Mason, who ended with 18 points, canned the subsequent free throw.
Bryant was then double-teamed at the other end, and he passed to Trevor Ariza at the top of the arc. Ariza drove into the lane, made contact with San Antonio's Manu Ginobili, but was whistled for traveling with 0.8 seconds remaining.
The Spurs inbounded the ball to Bonner to end the game, which included a wild shot by Tim Duncan with 28.9 seconds remaining. He lost the ball in the lane, but it somehow went into the basket to give the Spurs a one-point lead, setting up one of the best finishes in the league this season.
Ginobili had 27 points for the Spurs, who blew an 11-point fourth quarter lead, but still managed to win for the 10th time in 12 games. Duncan logged 20 points, 10 rebounds and eight assists, while Tony Parker also scored 20 in the victory.
Pau Gasol had 21 points for the Lakers, who had a four-game win streak broken. Andrew Bynum tallied 18 points and Fisher 16.
The Spurs led 30-29 after one quarter and the teams battled through a back- and-forth contest in the second with the hosts clinging to a 63-61 edge at the break.
The third quarter also ended in highlight fashion. Ariza nailed a three- pointer from the right corner with 4.7 seconds left, but Ginobili used a nifty dribble move and banged in a three at the buzzer for a 95-87 difference.
The Spurs widened that margin to 100-89 on a George Hill jumper with eight minutes remaining before the Lakers rallied thanks to Bryant. He had eight points in the final quarter.