Basel, who were appearing in their first European semi-final, looked set to earn a draw before hometown fans after a contentious 87th-minute penalty from Fabian Schar cancelled out Victor Moses' early opener.
However, deep into injury time, Luiz drove a 25-yard free-kick beneath the Basel wall and into the bottom-right corner to put Rafael Benitez's side in control ahead of next week's return leg at Stamford Bridge.
In the end, the only sour note for the visitors was a yellow card for Ashley Cole that rules him out of the second leg, although Basel will also be without centre-back Aleksandar Dragovic for the same reason.
Chelsea had welcomed Cole back after a three-week absence due to a hamstring injury, but their wariness was demonstrated by interim coach Benitez's decision to deploy centre-back Luiz in a midfield holding role.
Basel eliminated Tottenham Hotspur on penalties in the quarter-finals, having knocked Manchester United out of last season's Champions League, and they served early notice of their threat when Mohammed Elneny curled a cross onto the roof of the Chelsea net.
It was Chelsea, however, who took the lead in the 12th minute, to the disappointment of watching Basel native Roger Federer.
Frank Lampard drew a smart save from Yann Sommer with a near-post volley and from the resulting corner, the England midfielder's cross struck Moses and ricocheted into the roof of the net.
Basel responded immediately, briefly forcing the visitors onto the back foot.
Chelsea goalkeeper Petr Cech tipped a stinging Schar free-kick over the bar, while Valentin Stocker hit the outside of the post with a drilled cross from the right.
The away side finished the half strongly, though, with Sommer producing a sharp reflex save to repel Ramires' half-volley from close range.
Eden Hazard might have doubled Chelsea's lead shortly before half-time, but a last-ditch challenge from Park Joo-Ho put him off just as he was about to take aim at the exposed Sommer.
In the opening exchanges of the second period, both sides hit the woodwork with chances that would have greatly altered the face of the game.
First, Stocker rolled a low shot against the base of Cech's right-hand post, before Fernando Torres saw a left-foot snap-shot crash back off an upright after a bold run down the Chelsea left from Hazard.
Basel coach Murat Yakin introduced Marcelo Diaz and Jacques Zoua from the bench, and the hosts saw Fabian Frei and then Zoua shoot narrowly wide from just outside the box.
Cech saved at the feet of Salah, but after several nervous moments in the Chelsea area, the hosts' pressure told when Czech referee Pavel Kralovec penalised Cesar Azpilicueta for making contact with Stocker from behind.
Schar duly drilled his spot-kick down the middle, before Sommer produced a stunning point-blank save to deny John Terry, only for Luiz to strike in the fourth minute of added time to end Basel's unbeaten home record in this season's competition