The visitors enjoyed the better of the early exchanges and went ahead in the 39th minute.
An inch-perfect pass from Ryan Dickson split Rotherham wide open and Nathan Elder had no trouble beating Andy Warrington with a well-placed shot.
Rotherham should have equalised within a minute when Jamie Green’s cross from the left picked out Dale Tonge on the far side, but he headed wide.
The Millers failed to make any real impression until the 87th minute when sub Ryan Taylor picked out Mark Hudson on the edge of the area and his shot deflected off a defender and looped over the keeper.
But a quick break out of defence caught Rotherham napping and a ball over the top picked out Connell who slotted home.