How to change the internal logic of an IR sensor module?

An open collector output for such sensor modules is quite usual. This will give exactly the “inverted” effect which you have observed.