The Egypt star produced a clinical finish at the St. Jakob-Park to ensure the Swiss champion leapfrogged Schalke into second place in Group E, while Chelsea qualified despite the defeat.
Basel had ended the Premier League club's 29-match home unbeaten run in the group stages of the competition back in September with a shock 2-1 win at Stamford Bridge and it repeated the dose courtesy of Salah's dramatic late winner.
Murat Yakin's side now heads into its final group game against Schalke next month knowing it only needs a point to progress to the last 16.
Chelsea was poor on the night and failed to register a single shot on target, but Schalke's failure to beat Steaua Bucharest ensured it progresses.
Willian replaced Eden Hazard in the only change to the Chelsea side which beat West Ham United 3-0 at the weekend, while fit-again striker Fernando Torres was back on the bench.
Goalkeeper Yann Sommer, midfielder Salah and defender Ivan Ivanov all returned to the Basel starting line-up.
Chelsea manager Jose Mourinho warned Basel that his side was much improved since the Swiss champion's shock win at Stamford Bridge in September, but there was no evidence of that as the home side dominated the opening stages.
Petr Cech had to be alert to palm away a Taulant Xhaka free-kick from wide on the left after only two minutes and Chelsea failed to heed the warning when it backed off 10 minutes later and Fabian Frei's strike was saved by the Czech Republic goalkeeper.
John Obi Mikel then cleared off the line after Ivanov got a toe to a Fabian Schar corner and Salah was twice denied by the busy Cech as Chelsea remained on the back foot.
There was a blow for the visitor three minutes before half-time when Samuel Eto'o was carried off, with Torres replacing him.
Hazard replaced the ineffective Oscar nine minutes into the second half as Chelsea struggled to get going.
The Belgium winger and Torres provided more of an attacking threat and Mourinho's side was far more solid at the back after the break.
Ramires should have done better when he was played in down the right 12 minutes from time, but the Brazil midfielder lacked composure.
And Basel snatched a crucial winner when Salah raced away after Schar's pass, and he kept his nerve with a clinical finish to stun Chelsea.