For pipes nearer the horizontal I would use the rubber connector I linked to. For a vertical you can use one of the more easy to obtain ones with the fins on, but they take up what I think will be valuable vertical space.
So its time to measure very carefully to see what can be achieved.
first of all you need to measure
exactly what offset you need. That means if the wall is going to get tiled or something you need to allow for the tiles and adhesive.
Next is to find the bends that will do the job. If you can post the dimensions from the top of the lower CI collar to the floor level and then the offset (Centre to centre) I may be able to give you the exact fittings to get.
The old cast iron pipe will come out of the collar but it can take time depending on how sound the joint is.
Basically you have to dig out the old joint material. It may be topped off with a sand and cement fillet but that should not be too deep. After that the materials used are much softer. An old flat screwdriver is often handy for the job. Once you get the pipe loose it can usually be pulled out. Then stuff an old sack or something into the pipe to block it from falling debris and continue to clear out the old joint material.
Measure the outside diameter of the CI pipe once it is out and post the size.
The following will should fit a 4" cast iron socket without any narrowing of the pipe connection
Universal-Pipe-Connector
This type will fit into the pipe below the CI socket and the fitting itself should also fit inside the Cast iron collar
drain connector but the fitting does cause a small restriction on the pipe diameter. It may be the one to use if the vertical height is a problem