Leading 1-0 from the first leg, the Gunners were way below their best form and Pape Abou Cisse eventually made them pay by levelling the tie on aggregate with a 53rd-minute header.
Just as the match appeared to be heading for the first ever penalty shoot-out, Aubameyang smashed in a sensational 113th-minute strike to hand the home side the advantage.
Yet there was a dramatic sting in the tail as substitute Giorgos Masouras crossed for El Arabi to steer a low shot past Bernd Leno.
According to Evening Standard, there was still one last chance for Arsenal to win it.But Aubameyang somehow missed from six yards out in a central position.
The final whistle came seconds later, cueing jubilant scenes in the away end.
Arteta had named a strong side including Mesut Ozil, Alexandre Lacazette and Aubameyang but they could not muster a single shot on target in the opening 45 minutes and were made to pay for a lacklustre performance eight minutes after the restart.
Mathieu Valbuena swing over a corner and Cisse made the simplest of runs, completely unmarked, to meet the ball first time with a header that flew past Bernd Leno in a flash.
Olympiacos sensed a famous upset. Kostas Tsimikas jinked forward and let fly from 20 yards, forcing Leno into an acrobatic save away to his left.
Arsenal finally stirred into life as the game entered the final 15 minutes, Pepe collecting Granit Xhaka’s Crossfield pass to unleash a left-foot shot Jose Sa did well to save. From the loose ball, Shkodran Mustafi found Lacazette but he couldn’t make enough contact with a header inside the six-yard box.
Neither side could find a goal and so the tie went into extra-time, the first half of which saw Mustafi limp off with a hamstring complaint.
Utilising the availability of a fourth substitution, Arteta sent on Gabriel Martinelli for the second period.
Masouras hit the crossbar before Aubameyang appeared to have settled the tie with a superb acrobatic volley. But it was El Arabi and Olympiacos who had the last laugh, leaving Arsenal relying on qualifying for the Champions League through the Premier League.
Here are the 15 qualifiers for the next round:
Rangers, Roma, Wolfsburg, LASK, Basel, Leverkusen, İstanbul Başakşehir, Wolves
Shakhtar, Inter, Manchester United, Olympiacos, Sevilla, Copenhagen and Getafe.
The last qualifier will be known tomorrow between Salzburg and Eintracht Frankfurt. Frankfurt won the first leg 4-1.
*Match report by Evening Standard