How to trace from screen space?

I have those 2 cubes at some distance from each other, their collision box/trace doesn’t overlap in world space but I want to detect from camera when those 2 lines collide. Is it possible?

Multi box trace from camera doesn’t work. I’m trying to detect the overlap of the cubes from camera’s point of view but the box trace size increase as it get closer to the camera so it return a collision way before the cubes are actually overlapping. Any Idea?