Moussa Dembélé opened the scoring for the away side in the 15th minute at a sparsely-populated Allianz Riviera stadium, the Frenchman collecting Maxwel Cornet's cross before rolling home his 18th goal of the season.
Little else happened until the final minutes, when first Kasper Dolberg back-heeled straight to Lyon goalkeeper Anton Tatarusanu from a few yards out.
Adam Ounas then flashed home a leveller for the hosts in the 89th minute, but just seconds later Lyon were given a penalty for Dante's reckless tackle on substitute Karl Toko Ekambi, with Houssem Aouar tucking home the winning spot-kick.
Rudi Garcia's side will host Marseille, who are second in Ligue 1 and unbeaten since the end of October, next month.