Oxford led from the seventh minute when the home side were caught napping by a short corner. The ball was pulled back to the edge of the penalty area and Sean Rigg hit a first-time shot through a crowd of players into the net.
And they could have had a second three minutes later when Harry Worley got a foot to Jake Forster-Caskey's cross and diverted the ball just wide. But Rotherham started to fight back and twice in as many minutes Ben Pringle and Lionel Ainsworth hit the woodwork, and Rotherham's luck changed immediately after when they were awarded a penalty.
Kayode Odejayi was brought down by former Rotherham player Michael Raynes and O'Connor fired home from the spot. And in first-half added time Rotherham came within a whisker of the lead when Odejayi fired just wide from Pringle's lay off.
Oxford tried to put up the shutters after the break and held out against almost constant Rotherham pressure until the 73rd minute when Nicky Hunt broke free on the right. Odejayi headed Hunt's ball back across goal and O'Connor drilled home his second of the afternoon.
And with two minutes to go, it was substitute Jason Taylor who made absolutely certain with a simple tap in after great work down the right by Lionel Ainsworth.