How to physics raycast through overlay UI?

I have a transparent image full screen inside an overlay canvas. The transparent image only turns visible on horizontal swipes (pagination style). I would like to interact with my world space 3D objects with mouse input, but the overlay canvas is blocking my raycast. Are there any methods to pass through the overlay canvas image?

RayscastAll returns 0 if the raycast target of the image is set to true. I have to have it true, because I am detecting the swipe gesture on it.

Thank you.

Put the overlay on a dedicated layer and ignore that layer in the RayCast call (layerMask parameter).