Jose Mourinho's side were moments away from securing top spot in Group A when Lang pounced on sloppy defending to steal the points for second-placed Basel a minute before the end.
United hit the woodwork twice in a dominant first half, but they were outplayed after the interval and could have few complaints about Lang's dramatic winner.
United remain in first place and they just need to avoid losing by more than six goals at home to CSKA Moscow -- three points behind Mourinho's men on nine and level with Basel -- in their last fixture on December 5th to ensure their progress to the knockout stages.
Basel are also in the hunt heading into their last group game against Benfica, in which they just need to equal CSKA's result to qualify.
Mourinho will be especially frustrated by the defeat because it means he cannot afford to rest players against CSKA, just days before the Manchester derby.
"We lost because in the first half we should be 5-0 up but we could not score one goal after being so dominant," Mourinho said.
"It looks for many periods in the first half it was impossible not to win.
"I think the majority of the second half the feeling of everyone was OK, it will be 0-0, but they got the late goal."
Mourinho made seven changes from the team that beat Newcastle 4-1 at the weekend, with Argentine defender Marcos Rojo making his first appearance since a suffering cruciate ligament injury in April.
Mourinho had expressed concern about the pitch at St Jakob-Park after it was replaced following heavy damage during Switzerland's recent World Cup play-off with Northern Ireland.
However, United didn't seem bothered when they pieced together a sweeping move that almost brought an early opening goal.
Paul Pogba sliced through the Basel defence and found Romelu Lukaku, whose shot on the turn was well saved by Tomas Vaclik.
Moments later, the visitors went even closer when Marouane Fellaini's header was cleared off the line by Manuel Akanji.
Fellaini threatened again with another header that fizzed wide from Daley Blind's free-kick.
United were dominating possession without applying the finishing touch and Fellaini maintained that frustrating trend when the Belgian hit the post with a close-range header from Anthony Martial's cross.
Martial was denied by Vaclik at the end of a surging run before Rojo rattled the bar from long-range.
Having been penned back in the first half, Basel almost snatched the lead after the interval when Serey Die drilled just wide.
Suddenly unable to find any rhythm, United rode their luck again as Renato Steffen's powerful effort was narrowly off-target.
Mourinho sent on Nemanja Matic and Marcus Rashford, but United didn't respond and Lang nearly made them pay by crashing a header against the bar.
That escape was the signal for United striker Zlatan Ibrahimovic to come on in the 74th minute, for the second appearance since his return from a serious knee injury.
Die tried to steal the spotlight from the Swede with a 25-yard strike that drew a good stop from Sergio Romero.
Even Ibrahimovic couldn't help United stem the tide and Basel's pressure was finally rewarded in the 89th minute.
With United appealing in vain for offside, Raoul Petretta's measured pass found Lang and he tapped in at the far post to leave Mourinho cursing.