You need to use zgrep instead:
zgrep -a "text" compressed.gz
gz files using the grep command. Unfortunately, grep command is not
working on my compressed files. ... You need to use zgrep command
which invokes grep on compressed or gzipped files. All options specified
are passed directly to the grep command or egrep command