The Frenchman turned in a low cross from Bukayo Saka on 81 minutes to give the Gunners the lead and a crucial away goal after what had been a subdued affair at the Georgios Karaiskakis Stadium in Piraeus, Athens.
The hosts made a strong start as Mathieu Valbuena forced Bernd Leno into an early save and moments later Georgios Masouras headed just over the crossbar when well placed.
Youssef El-Arabi also came close but was denied by Leno.
Arsenal’s best chance of the first half fell to Lacazette but he missed the target from eight yards out.
Chances were few and far between after the restart as the two sides cancelled each other out.
Ousseynou Ba did come close for the hosts on 72 minutes but Leno was equal to his header.
The game seemed to be heading for a goalless stalemate until Pierre-Emerick Aubameyang picked up the ball on the left flank.
The striker held the ball up then fed it through to Saka, who picked out Lacazette inside the six yard box and he poked home into an empty net.
Arsenal could have doubled their lead soon after as Lacazette tried his luck but Olympiacos keeper Jose Sa managed to make the save, and from the resulting corner Sokratis was denied by the woodwork.
The Gunners are now well placed to reach the last 16 thanks to their win and an away goal in Greece, with the return leg set to take place at the at Emirates Stadium on February 27.