You must have enough free space to accomodate the new .gz file, before deleting the .Z file. The .Z file itself is not uncompressed to disk.
Even if gzip could further compress the .Z file, you still need enough space to store the .gz file while it's being created.
If space is so tight that you don't have enough room for the .gz file, then gzip it to another filesystem first. And depending on what's in the file, and the size and number of files, there's no guarantee that gzip will save you much anyway.