Olympiakos was eliminated from the Champions League when it slumped to a 2-1 defeat at Olympique de Marseille in Group C on Tuesday, with the two clubs left fighting for a Europa League spot.
The Greek side went ahead in the first half through Mady Camara, only for Dimitri Payet to score twice from the penalty spot after the break to give OM its first win and its first goals in the competition this season.
OM, who ended an embarrassing 13-match losing streak in the Champions League, is bottom of the group on three points, behind Olympiakos by virtue of the head-to-head rule.
Olympiakos hosts Porto and Marseille travels to Manchester City in the final group games next Wednesday.
Manchester City, who had already qualified for the knockout phase before kickoff, leads the group on 13 points after a goalless stalemate at second-placed Porto, who also advanced on 10 points.
At the Stade Velodrome, the visitors went ahead in the 33rd minute, as Marios Vrousai cut the ball back to Camara who fired it into the top corner from the edge of the box.
Marseille leveled 10 minutes into the second half when Payet converted a penalty after Florian Thauvin was fouled in the area by Pape Abdou Cisse.
Rafinha then handled the ball and Payet converted a second spot kick with 15 minutes left to give OM the chance to have something to fight for in the final game next week.