Los Angeles blew an 18-point third-quarter lead but went back ahead for good on Kobe Bryant's driving three-point play with 1:09 remaining. That gave the Lakers a 98-95 lead, and they held on despite missing four free throws in the final 16.8 seconds.
The normally reliable Steve Nash missed two with 2.7 seconds left, giving Detroit one more chance. Down by one, the Pistons inbounded from midcourt with 1.2 seconds to play. They tried a lob to rookie big man Andre Drummond, but with Gasol contesting the play, Drummond couldn't convert his one-handed dunk attempt.
The Lakers have won five of six, including their last two games without Dwight Howard. The All-Star center has been out with a right shoulder problem.
Detroit was still without guard Jose Calderon, who the Pistons acquired from Toronto on Wednesday. Calderon has not been available to play because of unresolved visa issues.
The Lakers trail eighth-place Houston by 3 1/2 games in the Western Conference playoff race.
Bryant scored 18 points but shot poorly from the perimeter. After an airball with the score tied at 95, he decided to drive to the basket the next time down. Bryant muscled through a foul and scored a basket that was counted on
Detroit's Will Bynum cut the lead to one, and after Gasol missed, Drummond missed a baseline fadeaway that would have given the Pistons the lead. Earl Clark missed two free throws for Los Angeles with 16.8 seconds left, but Bynum's driving shot over Gasol went off the glass and rattled in and out.
Nash entered the game as a 90.4-percent free throw shooter for his career—the top mark in NBA history for players with at least 1,200 attempts.
When he missed two in the final seconds, the Pistons shockingly had a chance to win, but Drummond just missed his dunk attempt and looked surprised that no foul was called on the play.
The Lakers scored 10 straight points early in the third quarter to take a 72-54 lead. Bryant highlighted that run with a one-handed dunk while Detroit's Brandon Knight tried in vain to prevent an easy basket.
The Pistons rallied quickly, with the 6-foot-11 Drummond showing off his athleticism around the basket. Drummond's two-handed dunk over Gasol made it 76-70, and the Lakers led 78-72 after three.
Bynum had 18 points and 10 assists for the Pistons, and Greg Monroe added 20 points and 12 rebounds.
Clark had 17 points for Los Angeles. Nash had 11 points and 10 assists.
Detroit's Rodney Stuckey was called for his third foul in the first quarter, then picked up a technical to boot. The Pistons did their best to exploit the Lakers in transition, but Knight missed a layup in the second quarter, and Kyle Singler missed one of his own moments later.
Detroit turned the ball over nine times in the half, and the Pistons finished the second quarter with a terrible defensive breakdown. Bryant was inbounding around midcourt with 0.4 seconds left in the half, and Clark somehow slipped free for an alley-oop dunk at the buzzer that gave Los Angeles a 62-51 lead.
The Lakers did a better job defending that situation on the final play of the game.
NOTES: Knight became tangled with Metta World Peace of the Lakers with 1:43 left in the first half. That got a rise out of the crowd, which no doubt remembered World Peace's role in the infamous "Malice at the Palace" brawl on the Pistons' court in 2004. World Peace was assessed a flagrant foul this time, but the situation didn't escalate. ... Bryant had five assists, snapping his streak of five straight games with at least eight.