If you cut the cast, cut it behind the hub.
But first measure to see what diameter it is.
Most new cast iron is 2-3/8"
Some of the old stuff is 2-1/8"
When I couple the small stuff, I use a Copper by cast coupling.
Or, it looks like a rubber seal is stuck in the hub, if so, you may be able to pull out the last pipe.
Toothpick? There was plenty of wood there already in that non load bearing wall. That had been done by the handyman before me.