Scott McLaughlin netted against the run of play after 54 minutes to give the Doonhamers hope of pulling off a fifth-round shock against their top-flight rivals, who have fallen victims to a number of cup upsets in recent seasons.
However Scott Vernon scrambled the ball home after 67 minutes following a long Kari Arnason throw-in to keep alive the Dons' hopes of reaching the quarter-finals.
Aberdeen were without new signings Gavin Rae, who was cup-tied, and Danny Uchechi - who picked up a knock in training.
The Dons made two changes from the side that defeated Dunfermline 1-0 with Stephen Hughes and Rory Fallon coming in for the injured Clark Robertson and Josh Magennis, who dropped to the bench.
The visitors' new signing, John Potter, was ineligible but Craig Reid and Stephen McKenna both returned after suspension.
There was a place in attack for top scorer Tom Brighton with former Don Nicky Clark, Gavin Reilly and Kevin Holt the men to make way.
The Irn-Bru League Division One outfit shocked Aberdeen with a 4-3 Scottish Cup semi-final defeat in 2008 but Craig Brown's side made a positive start to this game, eager to ensure there would be no repeat.
The Dons, who had already been dumped out of this season's Scottish Communities League Cup by Second Division East Fife, almost opened the scoring after only three minutes when Fallon tried to turn the ball home from a Fraser Fyvie corner but his effort went agonisingly wide.
Arnason, who picked up the first booking of the match for a high challenge on McKenna, was next to try his luck but the Icelandic international dragged his shot wide from 20 yards.
The home side continued to press for the opener with Ryan Jack sending an inviting cross into the middle which was volleyed wide by Fallon.
Aberdeen were forced to make a change after 31 minutes when Chris Clark limped off and was replaced by Magennis.
The Northern Irishman almost made an immediate impact but Lee Robinson in the Queens goal was equal to his low drive.
The Dumfries side carved out their first real opening just before the break but Jason Brown managed to keep out Daniel Carmichael's shot across goal and Sam Parkin was unable to turn home the rebound.
The visitors made the perfect start to the second half when, after weathering a period of Aberdeen pressure, they broke upfield and Parkin fed the ball into McLaughlin - who kept his composure and slotted the ball past Brown.
Queens had a lucky escape after 59 minutes when skipper McKenna's sliced clearance was well kept out by goalkeeper Robinson.
And the Dons went even closer after 65 minutes when Rory McArdle's header from another Fyvie corner crashed off the crossbar.
The equaliser arrived two minutes later when an Arnason long throw into the box caused panic in the Queens defence and Dons top scorer Vernon turned the ball home from close range.
Aberdeen introduced Mohamed Chalali for Fallon after 71 minutes as they looked for a second goal, while the visitors brought on Stephen Simmons for the tiring Allan Johnston.
The Doonhamers defended bravely in the closing stages as the relentless Aberdeen attacks continued, although the home support were not impressed at the final whistle as boos echoed around the stadium.