A couple of questions, what is the motor connected to i.e. how much torque do you need ?
If it's not connected to anything, why do you need 5rpm ? How accurate do you need it to 5 rpm ?
Stepper motors as suggested above are pretty easy to control, if you have a unipolar motor you only need to pulse the phases in sequence to make the motor move around a preset amount each pulse. Easily done with a counter type circuit.
You *may* be able to get your motor down to a much slower speed using PWM to control it but 5rpm may well be pushing your luck.