can you paint over peeling drywall?
That damage is from excessive exposure to water. It should be cut out and replaced. If you choose not to, you could get rid of the mildew by spraying with a bleach solution, after it dries, carefully cut away all the loose paper and give a skim coat of drywall compound for the paint to go over, since the gypsum core that is exposed is not really meant for finishing with paint.

I have in one occasion, in a restaurant, used white unsanded grout as a skim coat in a small area as yours where it was getting continually wet so it would hopefully hold up better. Paint is still the main barrier here regardless and a sound surface to keep the paint layer intact