Ryoya Morishita gave Legia an early lead with a header in the 11th minute, but Mattia Bottani levelled the score with his own header in the 40th minute, Poland's PAP news agency reported.
Albian Hajdari then secured the victory for the visitors with a decisive goal in the 74th minute in the Polish capital on Thursday night.
After five rounds of fixtures, Legia sit in fourth place in the Conference League standings, with 12 points.
Chelsea lead the group with 15 points.
The Polish side began their campaign with a 1-0 home win over Spanish team Real Betis. They followed it up with a 3-0 away victory against Serbian club TSC Bačka Topola and a commanding 4-0 home triumph over Belarusian side Dinamo Minsk on November 7.
Legia defeated Cypriots Omonia 3-0 in Nicosia in their fourth Conference League group-stage game on November 28.
The Polish team will face Sweden's Djurgårdens in Stockholm next Thursday in their final league-phase fixture.
Meanwhile, fellow Polish club Jagiellonia Białystok succumbed 0-1 to the Czech Republic's Mladá Boleslav in their fifth Conference League group-stage match on Thursday.
Jagiellonia, with three wins, one loss and one draw from their five games, sit eighth in the standings with 10 points.
The group stage of the competition concludes on December 19.
The top eight sides in the league phase of the new-look Conference League will qualify automatically for the knockout stages, while the teams finishing in ninth to 24th place will compete in a two-legged play-off to secure a place in the last 16 of the competition.
Teams ranked 25-36 will be eliminated from the competition, run by European football governing body UEFA.
The final of this season's Conference League will take place in Wrocław, Poland, on May 28, 2025.
(gs)
Source: IAR, PAP, polskieradio24.pl