Bouna Sarr fired the three-time champions ahead but Moussa Sao swiftly responded to level for the hosts.
Bouna Sarr fired the three-time champions ahead at the Stade Bonal but Moussa Sao swiftly responded to level for hosts Sochaux.
Goalkeeper Christopher Dilo then saved spot-kicks from Doria and Aaron Leya Iseka in the shootout as Sochaux, the only non top-flight team left in the competition, advanced to the quarter-finals.
"We're frustrated because we should have qualified, but that's the Cup for you," said Marseille coach Rudi Garcia.
"We knew it would be tough playing away.
"Hats off to Sochaux. They pushed when we scored and hit back with a magnificent goal. They then sat back and tried to hold on until the penalty shoot-out."
Sochaux coach Albert Cartier said his team's victory had been "deserved" and came "from the heart", adding that they regularly practised penalties.
"Generally we practise penalties at the end of very long training sessions so the players remain focused while fatigued, even if the context is obviously not the same."
Earlier, former Portugal international Sergio Conceicao made a winning start as Nantes manager with a 3-1 victory over Montpellier.
Argentine striker Emiliano Sala struck either side of a Kevin Berigaud goal at the Stade de la Beaujoire as Nantes became the first team through to the last eight.
Poland international Mariusz Stepinski added a third for Nantes on the hour, although the hosts played out the final few minutes with 10 men after the dismissal of Abdoulaye Toure.
The relegation-threatened Breton club appointed Conceicao last Thursday to succeed Rene Girard with Nantes languishing second from bottom in the French top flight.
Conceicao, 42, formerly held the reins at Olhanense, Academica de Coimbra, Braga and then Vitoria Guimaraes in his homeland.
Holders Paris Saint-Germain host Lille in a repeat of last year's final, while Monaco, Nice and Lyon are also in action on Wednesday.