Rovers were just seconds away from the semi-finals when Gilberto swept home Emmanuel Eboue’s cross in the 120th minute to force the nerve-racking finish.
Then Almunia - who had earlier made a dramatic double save to deny Rovers a 2-0 lead - kept his cool to save from Neil Roberts, Paul Heffernan and Paul Green.
It looked like substitute Green was destined to be the hero after he pounced on defensive hesitation by Philippe Senderos to poke Rovers in front for the second time in the 104th minute.
But Gilberto grabbed a dramatic lifeline.
Afterwards Gunners boss Arsene Wenger hinted he may recall some of his experienced players for the two-legged semi-final against Wigan.
He said: “They are a cup team and we had a very tough game at Wigan - so I will have to see what to do because it’s a unique opportunity to go into the final.
“We want to get into the final and it will be a very interesting game.”
Doncaster boss Dave Penney said: “It’s a cruel way to go - we know the ecstasy of winning on penalties against Manchester City and now there’s the dejection of losing tonight.
“But the players were magnificent - they were up against top-quality players and our work ethic was excellent - and so was the quality of football. It was just good to show we can play football - not just kick and rush.”
The result was incredibly harsh on the home side who looked certain to make the Gunners their third and biggest Premiership scalp of an amazing cup run.
Rovers had stunned Arsenal to storm into a fourth-minute lead.
McIndoe latched onto Paul Heffernan’s through-ball in the left side of the box and poked the ball past advancing keeper Almunia.
Van Persie was forced off injured in the 32nd minute being replaced by Nicklas Bendtner.
Arsenal had their best first-half chance in the 37th minute when Bendtner latched onto Lupoli’s superbly weighted cross and his header brought a wonderful, acrobatic save out of Budtz.
After riding a brief storm early in the second half, Rovers fashioned two glorious chances in two minutes to move within touching distance of the semi-finals.
First Almunia proved equal to Thornton’s powerful drive from the edge of the box, then moments later he parried Heffernan’s low effort and somehow scrambled to block the point-blank follow-up from Guy.
But Wenger’s men were level in the 63rd minute when Owusu-Abeyie cut in from the left flank and fired a shot which took a huge deflection off Thornton and found its way into the back of the net.
Bendtner came close four minutes into extra-time, his first shot in the box blocked by Nick Fenton and his second from the rebound deflecting off Budtz’s knee to safety.
Substitute Green pounced on Senderos’ mistake to seemingly poke Rovers into the last four in the 104th minute - before Gilberto’s dramatic equaliser forced the shoot-out.
And if any Gunners star deserved to be their hero it was Almunia who had kept his side in the game during a torrid second-half spell.
: Budtz, Fenton, Foster, Stephen Roberts, McDaid, Coppinger (Neil Roberts 102), Thornton (Green 85), Ravenhill, McIndoe, Guy (Oji 115), Heffernan.
: Almunia, Eboue, Senderos, Djourou, Cygan, Hleb, Song Billong, Silva, Owusu-Abeyie (Larsson 78), Van Persie (Bendtner 33), Lupoli (Gilbert 106).
: P Dowd.