Two other top flight sides were dumped out of the competition as third-tier CA Bastia scored twice in three minutes just before half-time to beat neighbours Bastia 2-0 while second division Lens eliminated Stade Rennes.
Ligue 1 leaders Paris Saint-Germain were pushed hard by fifth tier Arras before eventually edging into the next round with a 4-3 victory.
Epinal, 19th in the 20-club third division, scored in the 75th minute to force their visitors to extra-time at 3-3 after Lyon had recovered from going two goals down early on to take the lead midway through the second half.
Lyon, who are level on points with PSG at the top of Ligue 1 and were near full strength with goalscorers Bafetimbi Gomis and Lisandro Lopez paired up front, hit the woodwork twice in extra-time.
After the match finished all-square, the semi-professional side eventually snatched a 4-2 win in the penalty shootout after Lyon's Gueida Fofana and Bakary Kone missed their attempts.
"It's magical and now we hope to reach the last 16 and make history," Epinal goalkeeper Olivier Robin told French radio RMC.
CA Bastia's Yohan Truchet scored in the 39th minute and Remi Arnoux netted three minutes later as they overcame their local rivals Bastia.
Rennes' Julien Feret cancelled out Jerome Le Moigne's first-half opener for second division Lens with nine minutes to go, but Kevin Theophile-Catherine's own goal soon after handed the home team a deserved 2-1 victory.
Lowly Ligue 1 clubs Ajaccio and Reims were also eliminated by lower division clubs on Saturday.
PSG, who had rested Zlatan Ibrahimovic, Thiago Silva and several other first team players, worked hard to set up a last-32 home clash with Toulouse with a 4-3 win over lowly Arras.
The amateurs, who were two goals down after 10 minutes, gallantly clung on to the coat tails of their illustrious visitors and became the first fifth division club ever to score three against PSG.
In Marseille, Andre-Pierre Gignac struck twice to rescue the record ten-times winners, earning them a laboured 2-1 victory after extra-time over second division side and 2009 Cup winners Guingamp.
Queens Park Rangers manager Harry Redknapp was in the stands to watch France's Loic Remy, according to media reports.
Elsewhere, right-back Mariano's stoppage-time goal earned Girondins Bordeaux a 3-2 victory in a thriller at 10-man second-tier club Chateauroux.
Saint-Etienne won at Ligue 2's Caen by the same score, while French champions Montpellier defeated third division side Bourg Peronnas 2-1.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1