The London clubs celebrated on the final night of group stage action as Roma, Dynamo Kiev and the Belgian underdogs Gent also secured their places in the knockout phase.
Arsenal had needed to overturn a 3-2 defeat at home to Olympiakos earlier in the season when they faced the Greek champions away in a Group F showdown.
Arsene Wenger’s side had lost in Piraeus on three separate occasions in recent seasons but France striker Giroud gave them a first-half lead and crucially doubled their advantage shortly after the restart following superb play by Joel Campbell.
Giroud then netted a penalty in the 69th minute to seal Arsenal’s place in the last 16 for the 16th season in a row, although finishing second in their group exposes them to the possibility of being drawn against Real Madrid or Barcelona in the next round.
Group winners Bayern Munich finished with a 2-0 victory at Dinamo Zagreb thanks to a second-half Robert Lewandowski brace as Thomas Mueller missed a late penalty and coach Pep Guardiola claimed his 100th win in charge.
The draw for the last 16 will take place at UEFA’s headquarters in Switzerland on Monday.