optoisolator +ve polarity in - negative polarity out
It's not clear what polarity you want.  If you want inverting, then your circuit would work if you flipped the collector and emitter of the transistor.  With 0 V in you get 0 V out.  With +5 V in, you get -5 V out.

If you want non-inverting, then reverse the transistor and resistor (after flipping the transistor to the right C-E polarity).

However, you don't need to use a opto-isolator at all since both sides are connected to the same ground.  For a non-inverting level shifter, you can use a single transistor:



This is using the transistor in the common base configuration.

If you really do want inverting, then it takes two transistor, although there are then various options.  Here are just two of them: