O'Grady, who had earlier shot wide at Hillsborough, met Lewis Buxton's cross with a near-post header to score the decisive goal in the 73rd minute to move the Owls up to third place in the table and to within two points of their neighbours.
Lee Williamson went close to giving United a 16th-minute lead when his free-kick from just outside the area struck the underside of the crossbar and bounced down on to the goal-line. Stephen Bywater easily saved Richard Cresswell's follow-up.
At the other end, Steve Simonsen saved a Chris Lines free-kick and Reda Johnson headed over.
Towards the end of the first half, United striker Ched Evans put a long-range effort wide.
O'Grady struck and the Blades rallied but Evans saw his low free-kick easily saved by Bywater. The Wednesday goalkeeper also kept out a shot from substitute Ryan Flynn and tipped over a header from Matt Lowton in injury time.