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.