Pierrick Valdivia struck late in normal time to cancel out Jimmy Briand's opener before the teenage full-back sealed the visitors' passage to the last eight of the Coupe de France
The Ligue 2 outfit battled back from Jimmy Briand's opener after just nine minutes to book a last-eight meeting with Monaco, as Pierrick Valdivia's stoppage-time penalty took the game to extra-time.
Teenager Gbamin took centre stage after that, rising high to head home a corner and stun the hosts, who last week secured a spot in the Coupe de la Ligue final versus Paris Saint-Germain.
Forward Briand broke the deadlock when he headed in smartly from Miguel Lopes' delivery, which appeared to underline Lyon's status as clear favourites for the tie.
Lens looked to the bench for inspiration as coach Antoine Kombouare introduced Deme N'Diaye, scorer of an extra-time winner in the previous round against Bastia, and Adamo Coulibaly.
The changes initially had little impact, but as the game moved into time added on Coulibaly skipped into the box and was brought down by Bakary Kone, allowing Valdivia to coolly level from the spot.
And just four minutes into extra time, Gbamin powerfully headed Benjamin Bourigeaud's corner past Remy Vercoutre to seal a stunning win for Kombouare's men.