Two goals in the closing stages of the first half, by Admiral Muskwe and George Thomas, flipped the Premier League 2 fixture in the Foxes’ favour after Curtis Jones had put Neil Critchley’s side ahead with a fine individual effort early on.
But the young Reds spent much of the second period in the ascendancy and finally got their reward in the 95th minute, when Longstaff scrambled the ball over the line once Jones had volleyed Adam Lewis’ whipped cross back across goal.
Caoimhin Kelleher’s sharp save from Callum Wright kept Liverpool on terms shortly before Jones’ flash of inspiration at the other end arrived with 10 minutes gone.
Pedro Chirivella found his captain out on the left wing and Jones drove directly inside towards goal, twisting and turning away from Leicester full-back Mitchell Clark and dispatching a low, left-footed finish into the bottom corner.
The hosts, though, responded well to that early setback and would have been level quickly had it not been for Kelleher.
First, the young Reds’ goalkeeper palmed Muskwe’s low drive wide, before he then showed rapid reaction speed to repel Thomas’ fierce effort after a long ball down the middle had caught his defence out.
Liverpool were still carrying an attacking threat of their own, however, and Kelleher’s opposite number Viktor Johansson made two impressive stops of his own to keep Leicester within striking distance.
Jones’ blast from 20 yards was tipped over by the Foxes’ ‘keeper and, after half an hour, Johansson got down well to divert Herbie Kane’s curler wide of the post.
And those saves were to prove vital for Leicester, who went in at half-time ahead despite still being behind as late as the 42nd minute.
Muskwe scored the equaliser himself, the forward latching onto Chirivella’s loose back-pass before firing past Kelleher, and then turned provider for his skipper Thomas, who angled a first-time shot into the top corner from his teammate’s cut-back.
Another smart piece of goalkeeping by Kelleher, this time to parry George Hirst’s powerful shot away, denied the Foxes a third 12 minutes into the second half.
But it was Liverpool who spent the next phase of the game on top, Critchley’s team enjoying the majority of the ball as they probed for an opening.
Chirivella’s hit from just outside the area flashed wide, and Harvey Elliott couldn’t find the target after Jones had set him up after eluding Johansson with some neat footwork.
Lewis’ introduction from the bench armed the young Reds with the weapon of his dangerous delivery, and the Scouser’s first cross narrowly evaded all inside the area as the clock edged towards the 80-minute mark.
It appeared that Liverpool’s last chance had gone when another Lewis ball into the box was cleared in injury time.
Not so, however.
Jones did well to keep Lewis’ deep cross alive, and Longstaff was on hand to slide in a late, late leveller.
Liverpool U23s: Kelleher, Hoever (Williams, 79), Van den Berg, Boyes, Gallacher (Lewis, 69), Chirivella, Kane, Dixon-Bonner, Longstaff, Jones, Elliott.
Unused substitutes: Winterbottom, Clayton, Varesanovic.