Rochdale made heavy weather of winning a game they controlled virtually from the first whistle but, having failed to convert overwhelming superiority into goals, they nearly allowed the visitors to sneak back into the game midway through the second half.
The first period was one of almost total dominance from the home side and, after leading scorer Chris Dagnall and Gary Jones had both been denied by visiting keeper Nikki Bull, they deservedly took the lead in the 27th minute.
Dagnall found himself in space on the right and, when his cross was only half-cleared, recalled winger Adam Rundle gleefully smashed it home from the edge of the penalty area.
At the start of the second half, Dagnall produced a thrilling 60-yard run that ended with a shot hitting the upright.
He then missed a glorious opportunity from just five yards out and, on 65 minutes, the same striker saw his close-range effort superbly tipped on to the bar by the overworked Bull.
Having literally hung on for long periods, Aldershot, with five successive away defeats behind them, somehow clawed their way back into the game with an equaliser on 66 minutes when substitute Marvin Morgan bundled home from close range after home keeper Sam Russell had somehow kept John Grant's header out.
The home side then turned the screw again and took the lead on 81 minutes following good work by substitute Adam Le Fondre who picked out skipper Gary Jones and, when his shot was blocked, teenager Joe Thompson slammed home the rebound from 12 yards.
The visitors thought they had a second equaliser in the dying minutes when Ben Harding saw his effort saved but, as Grant bundled home the rebound, he was adjudged to be offside by an eagle-eyed flag-waving assistant referee.
In the dying seconds the home side finally made the points secure when teenage substitute Will Buckley combined with Le Fondre before bursting into the penalty area and producing a calm, left-footed finish to lift the ball over the advancing Bull.
While Aldershot are now beginning to find life in League Two difficult, especially on the road, last season's play-off finalists Rochdale are now warming to their task and, having picked up six points in five days, are now within touching distance of the top seven.