Although this question is a bit old, I'd like to add an answer since this question is top-most viewed one. In fact, there are 2 scenarios related to returning the compressed content.
The first scenario is when you want API Gateway to compress the content. As the accepted answer suggests, you can enable the content encoding on your API then deploy it.
The second scenario is your integration endpoint already compressed the result and you just want to bypass it via API Gateway. The traditional workaround was configuring it as a binary media type. However, this might be problematic since it will begin to treat all response with the media type as a binary. Additionally, if you need to deal with multiple media types, your only choice would be setting it as '*'. If you're using non-proxy integration, you will lose a chance to transform the result.
To address the second issue, now API Gateway implicitly assumes a response result as binary when a proxy integration is used AND the content is encoded (the response has Content-Encoding with the value other than 'identity'). You don't need to configure binary media types any more when these conditions are met.
However, if you're returning the actual binary media (e.g. image, video), you still need to configure them as binary media type(s).
You might wonder what happens when you have both scenarios. The short answer is that API Gateway will not compress again when the response already has Content-Encoding header.
Hopefully this helps.