Driving a DC motor (in one direction) with a microcontroller pin and an opto-isolator
A darlington configuration - putting the optocoupler output Q1 in series with the load - will increase the voltage drop across Q2. Also a power BJT transistor might have a gain of 30-50 tops let's say. So with that circuit your maximum load current is probably no more than 60-100mA (30-50 * 2.2mA), which is pretty low unless you have a very small motor.
You have a load current of 416mA (5W @12V) so you need a current gain of 189. You are not going to achieve this driving a BJT power transistor directly (as shown in your diagram). You would require another transistor stage - which if using a darlington style configuration will result in a large voltage drop and loss.
Consider using a MOSFET to drive the load? You would connect the collector of Q1 to 12V via a small resistor and connect the emitter to the MOSFET gate and to ground via a larger resistor used to deactivate the MOSFET. If you select a MOSFET with sufficiently low Rdson it will have lower voltage drop than a BJT transistor. There is also no limit on current gain with MOSFETs, however...
2mA drive is not a lot, if your load is small and you are using a MOSFET with small gate capacitance then this could be ok. But you might find that the gate capacitance of the MOSFET is too high for the 2mA drive, resulting in very slow switching speed and high switching losses. Directly driving a suitable MOSFET with only 2mA gate drive is almost definitely no good for PWM control - you might get away with it for on/off control.
I would suggest either using your Q1/Q2 darlington configuration to drive a MOSFET. Or to look for a pre-packaged solution, such as an optoisolator with built in gate-drive, or a motor driver IC that can boost the signal for you.
Other things to look out for:
Make sure the voltage rating of the parts is suitable. Can the optoisolator output handle 12V across it? The MOSFET gate might have a limit of 10V for example (although 20V is more typical), so you need to make sure you use a potential divider to keep the gate drive below that.