Sheffield United, brimming with confidence after five straight victories, had carved out a hatful of chances against struggling Doncaster.
But while the Sheffield side squandered opportunities, O'Connor accepted his gratefully by bundling the ball over from close range.
United, pushing for an automatic promotion spot, started brightly, with Stephen Quinn, Danny Webber and Billy Sharp linking as the little striker's low drive flashed a fraction wide of the target.
Greg Halford fired over before Neil Sullivan pulled of an eye-catching stop when diving to his right to palm away Webber's shot on the turn.
Doncaster's patient approach almost paid off as Martin Woods and John Spicer coolly exchanged passes and the former's angled drive spun wide of the far post.
Centre-back Matt Kilgallon glanced a header over from a Quinn free-kick as the Sheffield side squandered another opportunity.
Webber burst through minutes later but with players inside he hit a low strike from 18 yards which was smothered on the line by Sullivan.
Doncaster went ahead five minutes after the restart when Spicer pumped in a teasing cross which was scrambled in at the far post by O'Connor.
United centre-back Chris Morgan headed over a Quinn corner and Halford pulled an effort wide as the home side looked for a way back in a nerve-jangling finish.