That style of PVC flange will not provide a good seal to the cast iron hub below. Originally, the flange would have been cast iron and was connected to the soil pipe using a combination of lead and oakum, which is a hemp fiber. The oakum would be packed in around the fitting, and lead solder would get ladled over the top to make it water proof. The purpose of the oakum was to prevent the solder from falling through the gap in the pipe before it solidified. The original flange must have been removed as part of a bathroom remodel at some point.
Using lead and oakum is still used occasionally, but many installers have switched over to hubless fittings, which are connected by a type of coupling known by the brand name Fernco. To install the new one, use a reciprocating saw to cut the bell off the end of the cast iron pipe and use a piece of PVC pipe the same diameter to extend it to the proper length. Once that part is done, you can then install a standard toilet flange, and it should not ever leak again.