Mouse position on render target into world coordinates?

Hi, I have this widget with a render target, that captures the scene from a camera in real time.

Does anyone know how to convert the mouse position on the widget into coordinates in the world, to use with a Line Trace? Also accounting for any stretching that might happen to the widget, and any FOVs of the camera.

Basically I want to interact with objects in the 3d world by clicking on them in the widget.

Thanks.

I used this, now assuming that you want the object to shoot from your UI face, then this should work if im correct.