There's nothing special about serving files with query strings, they should in general still be compressed (they are on my server).
Unless there's something funny about the way you set up your OutputFilter? Let's see some httpd.conf. Where's the server?
eta:
<FilesMatch "\.(css|js|x?html?|php)$">
Curious — works for me, unless there's something else broken in the config stopping it. It might be better to use the more usual:
AddOutputFilterByType DEFLATE text/html text/css text/javascript text/xml text/plain
though. (Then it will only try to deflate PHP scripts' output when they're those types and not, say, if you're spitting out an image.)