Martin Odegaard’s wonderful first goal for the club had put the Gunners ahead in Greece but their latest defensive mix-up, this time between Bernd Leno and Dani Ceballos, gifted the hosts a leveller shortly before the hour mark.
However, Gabriel’s towering header put Mikel Arteta’s side back in front on 79 minutes before Elneny’s long-range strike secured a valuable cushion ahead of next week’s return leg in London.
Despite a north London derby lying in wait at the weekend, Arteta named a strong side, with this competition representing the club’s only chance of silverware this season – and only route into the Champions League for next.
Pierre-Emerick Aubameyang saw a header tipped onto the bar early on while Odegaard wasted a glorious opportunity from Kieran Tierney’s cut-back but the Norwegian soon made amends with a rocket of a strike from all of 30 yards to open his account for the club.
Arsenal had been dominant but, as had been the case at Burnley on Saturday, handed their opponents a route back into the game as Leno’s needless pass left Ceballos under pressure and allowed Youssef El-Arabi to steal in and level the scores.
But just as it looked as if Arsenal may be left to rue a missed opportunity, Gabriel’s magnificent towering header from Willian’s cross restored the advantage before substitute Elneny rattled home off the inside of the post to make it an excellent night’s work.