Unfortunately 9v is to high, the max voltage can only be 5v. I'm guessing it's 9v due to the 9v battery, I wonder if that sensor would work with 5v. Instead of using the battery if you power it with 5v from the controller does it still work and put out 5v/0v when it senses water?
If not there's two options, you could add 2 resistors as a voltage divider to drop the 9v to 5v, you would need a 4.7k and 10k resistor. It would also be good to add a 3rd 10k resistor to limit the current to the GPIO.
Or you could use a 5.1v zener diode with a 10k resistor which would do the same. The 10k resistor will limit the current to the GPIO and the diode will only allow 5.1v max to the the sensor port. This option is best as it doesn't matter what voltage the battery is at. With the voltage divider the output will vary slightly depending on the battery voltage. For example if the voltage was 11v the voltage would be 7.5v with the voltage divider which is too high but if you used the diode it would still be 5.1v.
If you want to go this route I can make a diagram showing how to connect it.