George Donnelly put Keith Hill's men in front but Aaron O'Connor levelled five minutes before half time.
Defender Kevin Feely snatched the victory four minutes from time to spoil Rochdale's party.
The visitors took the lead in the 27th minute when Jamie Allen fed Donnelly to score. The 19-year-old midfielder squeezed a pass through to Donnelly who rounded goalkeeper Ian McLoughlin and slotted into the empty net.
But County equalised before half-time through O'Connor. Jackson sent in a cross from the right that landed at the feet of Michael Flynn. His shot was blocked but fell to O'Connor who stabbed home for his first goal since last year's play-off final.
McLoughlin produced an athletic save to deny Matt Lund's 80th minute penalty after Jackson was sent off for fouling Ian Henderson.
The Exiles then marched downfield to bag the win when Feely rose to head in a looping ball past Rochdale stopper Josh Lillis.