I can't tell exactly what you have there now?! Is that the remnants of an abs flange? Do you have access from below? It doesn't look like just a pipe stub, which is what you need to install a new flange.
The new flange is supposed to be installed on TOP of the FINISHED floor, so if you have enough of a riser, you could fill the area around the pipe with thinset when you set the tile. It's easier to notch the tile for the fasteners before you set the flange, then you don't have to try to drill through it later.