The game was something of a "two halves" as Stockport were much the better side in the first period, but had to survive a second half onslaught after Rochdale had made a double substitution at the break.
Rochdale were showing a hangover from their 7-1 mauling at Lincoln on their last outing in the first period and, from the first whistle, Stockport looked much the brighter.
It came as something of a surprise that it took the visitors 20 minutes to take the lead and, when it did, it was a real bolt out of the blue. Picking the ball up in midfield and some 40 yards from goal, defender Ashley Williams produced a thunderbolt that left unsighted goalkeeper Matthew Gilks flat-footed.
The one sour note on the day for the visitors saw leading scorer Adam Le Fondre stretchered off on 39 minutes following a crunching tackle by Rochdale defender Nathan Stanton which left him on crutches.
Just before the break Stockport doubled the lead when defender Mark Jackson was adjudged to have handled a Gareth Owen header and full-back Mark Robinson calmly converted from the spot.
With the half time introduction of teenage striker Clive Moyo-Modise and midfielder Darrell Clarke, Rochdale were much improved after the break and were themselves awarded a penalty when Glenn Murray went down in a heap following an aerial challenge with Rob Clare. Skipper Gary Jones calmly slotted home to give his side hope.
Rochdale were by now in control and in search of an equaliser, but were met by a series of fine saves by Stockport's on-loan goalkeeper John Ruddy.
Striker Tes Bramble had a real opportunity to put the game beyond Rochdale on the hour, but he somehow contrived to miss having rounded keeper Gilks and with the goal at his mercy.
Rochdale continued to press but Bramble finally managed to find the net for the first time this season when, with another one-on-one, he made no mistake from the edge of the penalty area on 81 minutes.
In the dying minutes Ruddy again came to the fore with two splendid saves from Morike Sako, one of which he tipped onto the underside of the crossbar to keep his side's lead intact.