"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.
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 :)