Benik Afobe and Samir Carruthers gave the Dons a two-goal lead at half-time and Dele Alli, Will Grigg and Ben Reeves put the Dons into an emphatic lead, before Conor Hourihane and Devante Cole scored to spark a late comeback.
Dons grabbed the opener when former Arsenal striker Afobe capitalised on Adam Davies’ sloppy parry, tapping home past the home goalkeeper.
The visitors doubled their lead following good work from Dean Bowditch down the right, before his pull back found Carruthers, who smashed the ball into the net.
The visitors looked to have sealed the victory in the second half when Alli raced through the Reds’ defence to dink over a helpless Davies, before substitutes Grigg and Reeves both broke clear to add another two goals.
Midfielder Hourihane launched a late salvo for the home side as Barnsley eventually got on the score sheet with a brace from the Irishman before Cole struck a third for Danny Wilson’s side with a header in stoppage time.