Following Piotr Cichocki's 10th minute opener, Layton Ndukwu and Josh Knight turned the match on its head before the break, only for Mateusz Bondarenko to restore parity after the hour-mark.
Steve Beaglehole elected to make five changes from the side who overcame Everton in PL2 on Monday, with places for Ndukwu, Alex Pascanu, Admiral Muskwe, Lamine Kaba Sherif and Max Bramley.
Shot-stopper Bramley was called into action early on after neat interplay between Grzegorz Aftyka and Robert Bartczak allowed the latter to get a shot away, but it was routinely batted away.
After 10 minutes, the Polish visitors were in front, though, as Cichocki muscled his way beyond Hamza Choudhury before slotting it beyond Bramley in the net.
As the rain lashed down in Whetstone, City battled against the elements to try and force their way back into the clash. Legia, however, defended steadfastly.
Their resolve was being severely tested and, in the 20th minute, it buckled. Josh Gordon charged down the right wing before crossing for Ndukwu to tidily convert at the far post.
It got better for the hosts with 11 minutes of the first half remaining. When Ndukwu’s corner was squeezed through the pack, Knight was on hand to bundle it beyond Konrad Jałocha.
It was nearly three for City soon after when Ndukwu bamboozled two defenders to carve open a path on goal, but his shot was deflected off Tomasz Wełnicki and into Jałocha’s grasp.
Just before the interval, Josh Eppiah, who had earlier replaced the injured Muskwe, tested Jałocha, although the experienced Polish stopper got a leg to it.
Eppiah was seizing his opportunity to impress Under-23s boss Beaglehole and it was his gallop into the Legia box which presented a final chance of the first half.
However, the Belgian’s fearsome drive was arrowed just wide of the left post from 20 yards.
Eppiah emerged from the break in the same eager mood and he took less than two minutes to rattle the crossbar with an emphatic effort from a tight angle.
Despite a glut of half chances, with Gordon at the centre of them all, City lost their advantage just after the hour-mark when Bondarenko nodded it in after a delivery from Mateusz Praszelik.
Two agonising misses were yet to follow for the hosts as George Thomas ghosted into the area before it fell to Ndukwu, but Łukasz Turzyniecki blocked brilliantly.
They got even closer to grabbing a dramatic winner in added time, but Kiernan Dewsbury-Hall's low shot came bouncing off the base of the post.
It just wasn't to be. Nonetheless, the unbeaten run stands at a magnificent 15 matches following this result.
Major moment…
Despite the frustration of losing their lead, Josh Knight's effort before the break was a significant one and gives the Foxes a chance of reaching the knockout stages.
A showdown with second placed Sunderland awaits Steve Beaglehole's young side at Eppleton Colliery Welfare Ground next month.
Who impressed?
A tricky winger with bags of ability, Layton Ndukwu has already showcased his talents this term after winning the PL2 Goal of the Season award last year.
While his effort on Thursday was a lot more simplistic than his half-way line strike against Liverpool in December 2016, it was due reward for another tenacious display.
Where does it leave us?
City are level on four points with Sunderland, one ahead on goal difference at the top of Group B, before their meeting in the North East on Tuesday 23 January (7pm kick-off).
Coming up…
City travel to Leigh Sports Village on Monday to tackle Manchester United in PL2 (7pm kick-off) before Barnsley visit Holmes Park in the Premier League Cup on Thursday.
The details…
City: Bramley, Pascanu, Wood, Kaba Sherif (Johnson 77), Knight, Choudhury (c), Hughes, Thomas, Muskwe (Eppiah 32), Ndukwu, Gordon (Dewsbury-Hall 65).
Subs not used: Yates, Martis, Uche Rubio, Bolkiah.
Goals: Ndukwu 20, Knight 34.
Legia Warsaw: Jałocha, Turzyniecki, Wełnicki (c), Bondarenko, Bartczak, Praszelik, Nishi, Cichocki (Olejarka 45), Welniak, Aftyka (Pietrzyk 55), Góral (Karbownik 78).
Subs not used: Lakota.
Goals: Cichocki 10, Bondarenko 65.
Referee: Andrew Miller.
Attendance: TBC