Rovers, who were top of Group E at kick-off, conceded four first-half goals and gave away a penalty as they were embarrassed by what was believed to be Barnsley's youngest-ever side in the opening period.
Sixteen-year-old Fabio Jalo helped himself to two goals for the visitors along with former Doncaster loanee Josh Martin.
A second-half brace from substitute George Miller helped salvage some pride, however, with the game finishing 4-2 to Barnsley, who secured qualification.
Doncaster now need Newcastle’s under-21s to take points from Lincoln to qualify.
A second-half brace from substitute George Miller helped salvage some pride, however, with the game finishing 4-2 to Barnsley, who secured qualification.