It is possible to use two pins both for I2C Slave and for Digital Output
Each port in PSoC 4 has a dedicated High Speed I/O Matrix (HSIOM) register. The value in this register determines the source which is connected to each GPIO pin in that particular port. Each HSIOM register is 32-bit wide, where four bits are allocated for each pin in that port.
The 4 bits corresponding to each pin can be configured to select proper source for the GPIO.
Please refer to the following KBA link to switch a GPIO between different sources: https://www.cypress.com/comment/362321
You can follow similar steps to configure the pins as I2C Slave pins or digital output pins depending on the digital input state.
For more details on HSIOM you can refer to the High Speed I/O Matrix section of the Architecture TRM of the device you are using.
Please feel free to update in case of any clarification.