Level shifter for multiple voltage levels
This particular circuit ONLY works if the signals are open-collector or open-drain, other wise you have this....







simulate this circuit &ndash; Schematic created using CircuitLab

Since you are using the circuit for I2C, that should not be an issue here provided the GPIOs are initially configured correctly at all three points.