"Did you drink water?"
Translation:क्या तुमने पानी पिया?
You're right that it should match the direct object's gender, but पानी is actually masculine, despite the ी ending, so the solution "क्या तुमने पानी पिया?" in this case is correct.
Sites like Shabdkosh and Wiktionary are great for finding out the gender of words, if you're unsure of them. They've been pretty invaluable to me.
Pi is when you order someone to drink water that would be pani pi and when you say or order in more respectful way that would be पानी पीए ( pani piae) in response you say mene pani 'piya' i drank water so piya is actually past tense and future would be 'me pani piuga or piugi if girl' (i will drink water)
I would still suggest you to go through all possible sources to confirm the same. As far as I am aware पिया means beloved or husband whereas पीया is the past tense of the verb पीना which means to drink. पीया sure is a name but it doesn't apply here. I very well know it's Hindi and a little matra makes a huge difference :)