A hugely entertaining contest between two impressive teams was eventually settled in the young Reds’ favour thanks to substitute Virtue’s last-gasp strike, which came at the end of a swift breakaway just moments after Joe Gomez had headed a shot off the goalline at the other end.
Ben Woodburn’s brace put Mike Garrity’s side 2-1 up after City’s Paolo Fernandes had opened the scoring with a penalty in the 19th minute of an end-to-end first half.
Isaac Buckley-Ricketts pulled the visitors level late on, but Virtue had the final say to seal a win that means Liverpool could finish above City in second place in the table should they take three points from their final game of the season, which comes on May 8 against champions Everton at Goodison Park.
Ovie Ejaria - making his first appearance in a red shirt since late January following an ankle ligament injury - played for an hour, with the midfielder joined by the likes of Woodburn, Trent Alexander-Arnold and Marko Grujic in a strong Liverpool starting line-up.
LFCTV GO: The City thriller in 90 seconds
It was Woodburn who went desperately close to scoring first amid a fast-paced, high-quality start to the game.
Angus Gunn did well to parry Grujic’s powerful header from Harry Wilson’s inswinging corner, but the City goalkeeper could do nothing about Woodburn’s follow-up snap-shot, which struck the angle of post and bar.
It was the visitors who went in front soon after, though, when Fernandes squeezed his spot-kick beyond Kamil Grabara after Alexander-Arnold had felled Buckley-Ricketts in the area.
The woodwork saved City again as Liverpool sought a quick response, with Sheyi Ojo rattling a first-time shot off the post after latching onto Grujic’s measured through-ball.
But the young Reds didn’t have to wait much longer to equalise, as Woodburn rounded off a brilliantly-incisive team move midway through the half.
Gomez’s raking cross-field pass was cleverly flicked inside by Wilson to the marauding Alexander-Arnold, who slid the ball into the path of Woodburn. The young Welshman duly finished unerringly across Gunn and into the far bottom corner.
Grabara then denied the lively Buckley-Ricketts twice in quick succession prior to a breathless first half coming to an end.
Rhian Brewster side-footed Ojo’s pull-back wide from close range early in the second half as the frenetic tempo showed no sign of slowing after the break.
Yet more adventurous football from both teams made no impact on the scoreline - until, that was, Woodburn grabbed his second of the game 18 minutes from time.
Brewster intercepted a wayward pass from Buckley-Ricketts inside his own half, raced forward and fed Woodburn, who coolly slotted past Gunn with his left foot.
But no sooner had Liverpool edged ahead, City were back on terms when Buckley-Ricketts converted Fernandes’ corner from inside the six-yard box.
A fittingly-exciting conclusion ensued, as Gomez cleared Buckley-Ricketts’ effort off the line and Liverpool quickly went up the other end and snatched victory courtesy of Virtue’s low finish.
Liverpool U23s: Grabara, Alexander-Arnold, Gomez, N Phillips, Randall, Grujic, Ejaria (Virtue), Woodburn, Wilson, Ojo (J Williams), Brewster (Dhanda).
Unused subs: Firth, Whelan.