Get coordinate of point after perspective displacement

When an ortographic camera is looking to a sphere with center (0, 0, 0) the rightmost point in the sphere is (100, 0, 0). But when a perspective camera is looking to the sphere at some close distance (the whole sphere still can be seen), the rightmost point may be (98, 0, 20), for example.

The “displaced coordinate” is the “inverse projection” of a coordinate. The coordinate (98, 0, 20) appears in the same place as (100, 0, 0) would appear if the camera was orthographic instead of perspective. So the “displaced coordinate” of (100, 0, 0) is (98, 0, 20) in the example.

How do I get the “displaced coordinate” given the point coordinate, the projection matrix and the camera position?

This is useful to know the distance of a pixel to the sphere center independently from the screen size.