If you take something like an ice pick, is the wood delaminated and soft? If it is, then you need to cut it out and replace. If it is not delaminated and is just wet, you should be able to leave it.
Since you apparently have easy access from below, I'd just cut the old flange out of there and install a new one at the proper place - on top of the finished floor. It appears that that is a 4" pipe. With that, you can use an internal mount flange or one that slides over the existing pipe and does not contain a hub. If you use an internal mount one, you can tile right up to the pipe. If you use an external mount one without a hub, you can leave the pipe long and when ready, glue the new one on, sliding it down to the tiled surface, then cutting off the excess pipe sticking out.