it just works like any other displacement map. The lighter the map the more that part of the image will extrude from the background.
Just bring your photo into photoshop and start painting on a separate black layer with a very soft white brush. When you’re done just discard the original photo in photoshop so that just the displacement map is left. Bring both the map and the original photo into After Effects. Put the displacement map effect on the original photo and point the source layer to the map you just made in Photoshop.
I think that should do the trick.
It can be bit tricky to get it exactly right though. But you did an excellent job with the King Kong image.