The on-loan St Johnstone striker was the last man to net for the Dons with his winner against Kilmarnock back on February 20.
And it took his goal seven minutes from time to squeeze Aberdeen past Jim Duffy's Sons.
With new boss Scott Glass still isolating following his return from America, Paul Sheerin was again in charge of the Pittodrie outfit at the C&G Systems Stadium.
The former Atlanta United coach – who is not due to take over until after next week's trip to St Johnstone – has appointed former England attack guru Allan Russell to his backroom staff.
But he will have his work cut out after another toothless display left them fearing a major upset as Dumbarton came close on a couple of occasions.
Neither side had much to lean on in terms of recent form. While the Dons had won just once in their previous 10 games, their part-time hosts were not faring any better, with just four wins all season leaving them second bottom of League One.
Aberdeen had enough chances to claim a half-time lead but again their cutting edge was glaring. Florian Kamberi should have scored inside six minutes but hooked wide.
Aberdeen continued to create – and miss – chances. McGinn swept wide from eight yards, Lewis Ferguson's header was pushed away again by Ramsbottom while Andy Considine could not turn home from point-blank range as Nat Wedderburn threw himself into a heroic block.
And it should have been the Sons who claimed a shock lead eight minutes before the break as Ramsbottom's long free-kick broke to Ryan McGeever in the perfect position, only for the defender to scuff his big moment straight at Joe Lewis.
Duffy made a half-time switch as he introduced Rabin Omar for Tomas Brindley and the Dutchman almost made an immediate impact as some shambolic Dons defending allowed him to sneak through on Lewis, who had to make a big save to rescue the Pittodrie men.
Kamberi was replaced by Hendry on 55 minutes after a thoroughly laboured showing, but the change did not have the immediate impact Sheerin was hoping for as Aberdeen continued to huff and puff.
Ross McCrorie volleyed over following good work by McGinn down the right, while Hayes and McGinn were both frustrated by quick-fire blocks as the combined efforts of McGeever and Nick McAllister kept Dumbarton in the match.
But to the Dons' great relief they finally made one of their chances pay as the clock ticked into the final 10 minutes.