It took the visitors just three minutes to go in front. Elliott Parish failed to hold a long-range effort from Kieran Agard and Dicko latched on to the rebound to net with the aid of a deflection off Aden Flint.
City were wide open and when Jay Emmanuel-Thomas gave the ball away on the edge of the Rotherham penalty area in the 26th minute, Lee Frecklington was allowed to run at the home defence unchallenged before feeding Ben Pringle, who swept home the visitors' second goal.
Substitute Bobby Reid reduced the arrears in the 81st minute when his curling cross from the left crept in at the far post without anyone getting a touch.
Rotherham goalkeeper Adam Collin then saved well from Sam Baldock as the hosts pressed for a late equaliser.
But Steve Evans' Millers held on and the result meant City slipped to the bottom of League Two.