It was the Spurs' first home loss this postseason, and the defending champions face elimination when Game 5 is played in Los Angeles on Thursday.
Tim Duncan led the Spurs with 29 points and 17 rebounds. Reserve Brent Barry had 23 points and his last-second 3-point attempt could have given the Spurs the win. He claimed he was fouled on the play by Derek Fisher but there was no call.
"If I was the official I wouldn't have called that a foul," Spurs coach Gregg Popovich said.
The Lakers led all game after opening a 22-8 lead. The Spurs got within 81-79 in the fourth quarter, but the Lakers scored seven straight points.
Lamar Odom scored 16 points for Los Angeles - eight in the fourth quarter.
"I told them at the end of the ballgame, their energy was terrific," Lakers coach Phil Jackson said. "Coming out and responding to a loss and getting a lead ... and playing with that kind of energy, I think, carried us over and we responded every time that they came in, tied the ball game."
Tony Parker added 23 points for the Spurs.
"It was just a good defense and we missed a lot of easy shots," Parker said. "You know, myself, Timmy, we missed a lot of layups. It was just never - we never (were) in a good rhythm."
The Spurs shots 40 percent (30-of-75) from the field and the Lakers shot nearly 45 percent (38-of-85).
With the Lakers up 93-86 and 50 seconds to play, Pau Gasol missed two free throws after being fouled by San Antonio's Fabricio Oberto.
Manu Ginobili, who had struggled all night, hit a 3-pointer to bring the Spurs within four. After a miss by Bryant, Parker scored on a fast break when Odom was called for goaltending, bringing the Spurs within 93-91 with 28 seconds to play.
Fisher missed a shot for Los Angeles but the ball went out of bounds and remained in the Lakers' possession with 2 seconds on the shot clock.
Bryant missed a jumper and the Spurs had 2.1 seconds left. When Barry's 3 missed, Bryant pumped his fists in the air and the Lakers were headed home with command of the series.
The Lakers were last in the finals in 2004 when they lost to Detroit in five games.
The Lakers were up 77-70 heading into the fourth quarter. Barry's 3 brought the Spurs within 77-75 and his running jumper got them to 79-77.
Odom's layup balanced on the rim before falling in, and he hit a free throw for the three-point play to start the 7-0 run. Bryant stole the ball for a slam to put the Lakers up 88-79 with 3:29 to play.
Parker got the Spurs within five, then Odom hit two free throws to put the Lakers back up by seven with just under a minute to play.
Los Angeles came out with energy and took advantage of sloppy play by the Spurs to lead by as many as 14 points in the first quarter.
The Lakers dominated the offensive glass, racking up 20 second-chance points in the first half off their 17 offensive rebounds.
Odom, who was upset with his Game 3 performance, highlighted the Lakers' aggressiveness. Early in the first quarter he missed a shot, then suddenly appeared under the basket to grab the rebound and was fouled, making both free throws.
San Antonio was within 28-23 at the end of the opening period.
In the second quarter the Lakers got into foul trouble and San Antonio made the most of it at the free throw line. The Spurs were 17-of-17 in the first half as Odom, Fisher and reserves Jordan Farmar and Sasha Vujacic all picked up their third fouls.
Duncan's jumper tied the game at 45 with 2:10 left in the half. After Luke Walton missed a free throw and a chance for a three-point play with 23 seconds left, Vladimir Radmanovic chased down the ball and Bryant converted to give the Lakers a 53-47 halftime lead.
It was more of the same in the third. The Spurs tied it twice but never took a lead.
Tied at 67, Bryant found himself all alone. He took the long pass from Odom and dunked the ball with flash and flair, drawing resounding boos from the crowd. Another dunk by Bryant made it 73-70 before Vujacic was fouled hitting a 3-pointer from the corner. He made the free throw to give Los Angeles a 77-70 lead with one quarter to go.
Notes: Joe Crawford, who has a history with the Spurs and had an on-court squabble with Popovich during the conference semifinals, officiated the game. ... Spurs legend David Robinson sat in the second row courtside. He was surrounded by Lakers fans wearing bright yellow jerseys. ... Ginobili got his first points of the game with 1:32 left in the third quarter on two free throws. He finished with seven points, 23 less than he had in Game 3. ... The Lakers outrebounded the Spurs 46-37 and finished with a 26-4 advantage on second-chance points. ... Bryant didn't get to the free throw line.