The built-in ip-filter
policy uses the value from context.Request.IpAddress and there is no way to configure this otherwise. The alternative would be to implement the validation logic using policy expressions.
Here is a sample that highlights how something like this can be achieved when APIM receives requests from Application Gateway. This is remarkably similar to your own scenario and should work with minor changes (like the header name for instance).