Great question, and I'm not the one you asked, but here's my two cents anyway :-)
I would likely do what you did and say hell no (tho this may lead them to believe I was actually lying, even tho I'd be clear that I felt it was an invasion of my privacy). If I really wanted the job for some reason (maybe I'm desperate, or their tech really is that 1337), and felt like they were asking in good faith (didn't want to be conned, especially if their market data would say I was already statistically way on the high end), I might counter by offering a previous paystub or something (w2 doesn't often tell the whole story, and can also give them more info than they need. Yes I'm paranoid).
If I had lied tho? Well I might just cut my losses, knowing that it would be interpreted as me being guilty, but then again I would be guilty. I do wonder tho if somebody would resort to GIMPing their w2 or paystub to fudge the numbers? IDK. I couldn't do it without feeling like a horrible person, but I'm unusual.