Dagnall netted either side of Marlon Harewood and despite Dean Bowditch replying for Dons, Barnsley held on.
The game ended with former Leeds striker Alan Smith sent off in 12 minutes of stoppage time after a lengthy injury to Reds midfielder Kelvin Etuhu.
Barnsley manager David Flitcroft admitted the injury to Etuhu overshadowed his side’s win over MK Dons and also revealed a home supporter was ejected for abusing one of his players.
Flitcroft’s thoughts after the match were very much centred on the injury to Etuhu, who was stretchered off after a clash of heads with Adam Chicksen.
“I think it threw my players quite emotionally, it can do that to a team,” he said.
“It worried me to be honest. When he came past me he wasn’t unconscious but he wasn’t responding initially.
“MK Dons’ staff were impeccable and were very professional in the way they dealt with it. He has gone to hospital for a check but he is okay, he is stable.”
Flitcroft said he had also been informed one of his players had been abused by an MK Dons fan and stepped in to defend his man, with the supporter escorted out of the stadium as a result of other crowd members reporting him to stewards.
“I felt one of the fans was having a go at one of my players so I responded in the heat of the moment, I will protect my players to the hilt,” he said.
“I think MK Dons are looking into the incident. I just asked if a gesture had been made could the man be taken out of the stadium.”
MK Dons are expected to release a statement in regards to the issue and Flitcroft would not confirm which player was abused, although he did say it could be an “alleged racist incident”.
On the achievement in reaching the last eight, something Barnsley have not done since going all the way to the semi-final in 2008, Flitcroft said: “We’re in the last eight of a competition I absolutely love. I’m trying to make new heroes at the club.”
Milton Keynes Dons: Martin, Otsemobor, MacKenzie, Williams, Lewington, Potter, Harley, Bowditch, Chadwick, Powell, Smith. Subs: Doumbe, Chicksen, Flanagan, Ali, Alli, Lines, Rasulo.
Barnsley: Steele, Wiseman, Cranie, Kennedy, Hassell, Etuhu, Perkins, Mellis, Golbourne, Dagnall, Harewood. Subs: Alnwick, Foster, Delap, Scotland, Cywka, Rose, O’Brien.
Referee: Mike Jones (Cheshire)