No. Java is using the zlib deflator, which is derived from but not exactly the same as the older gzip command-line utility deflator. They will generally not produce the same output and there are no settings to coerce them to do so.
Compression level -1
requests the default compression level, which in the current zlib implementation is level 6
.
I would have to ask why you care to get their outputs to be the same. All that matters is that the compression is lossless, i.e., that both the gzip and Java compressed streams produce the same original data when decompressed. There is no requirement that, for example, different versions of zlib produce the same output at the same compression level.