Up until the 60th minute Macc's defence had been resolute, but when Jon Brain saved bravely at the feet of O'Grady, the ball ricocheted off defender Nat Brown to float over the stranded goalkeeper for the deciding goal, which was credited to the Dale striker.
Macc had started brightly with Ricky Sappleton sending a 20-yard left-foot drive inches over the bar.
The league leaders then took control with Gary Jones twice forcing saves from Brain before he scooped a simple shot from 10 yards hopelessly over the bar with only the goalkeeper to beat.
After the break, Macclesfield might have opened the scoring when Colin Daniel was left unmarked at the far post, but his low shot was blocked on the line by Will Atkinson and they were made to pay when O'Grady broke the deadlock.
Macc's season-long weakness in front of goal was again exposed in the closing stages with Craig Lindfield heading over the bar after 75 minutes and then slicing wide. Rochdale's top scorer Chris Dagnall also inexplicably missed from just two yards out.
Source: Team Talk