I would recommend getting a 4" (or 3" depending on your cast iron pipe) coupling like this.
You may also want to clean up the cast iron a bit if you are able to. If the top of the pipe is jagged or pitted, you could take a file or a flap-disk angle grinder to it to polish it up. Maybe not a huge deal, but I'm kind of a perfectionist. It theoretically shouldn't make much difference.
Also, while you have the flange off, you might want to make sure the cast iron isn't rotted through in any visible part that you can see with a light. if it is, you'll need to replace the whole toilet drain with something like PVC or ABS (which wouldn't be a bad idea even if it's not rotted!).