Render object partly hidden
Certainly is possible. What you want is the same techniques used in motion capture and compositing.

There are three key elements here:


Matching the perspective of the camera in the photograph.
Reflection of the environment onto the object (most importantly the table).
Shadows of the object onto the environment.


To solve the perspective problem, there is an old addon for Blender called BLAM, it's discontinued but still works for now. They are however recommending that instead of using BLAM you use a new tool called fSpy, I haven't used fSpy personally but it looks very good.

Once you've matched the camera's, try and get an HDRI that matches your environment. If you took the background photo yourself, you could try and capture an HDRI yourself. Alternatively, you could find a different HDRI that resembles the background image. You could probably get away with unwrapping the background image onto a cylinder around the object actually but you will have to experiment to see what looks good.

To cast shadows on (and cut into as requested) the table you will need to use a shadow catcher. Create a plane and scale/position it to match the table. If your object is reflective, I would suggest projecting the table image onto the shadow catcher plane. This will create realistic reflections that match the environment. Place your object as you like on top of (or cutting inside of) the plane. With the plane selected, navigate to the object panel and enable Shadow Catcher.



You can now render this and export it as a PNG, and then put it onto of the background image in Photoshop. Or, if you're familiar with compositing nodes you could do it in blender.

Below is a simple scene. A Suzanne and a plane. Notice how Suzanne is glossy and you can see the reflections of the UV grid.


Shadow catcher enabled on the plane. Notice how you can still see the reflections of the UV grid.


Suzanne cutting into the plane. Still showing the reflections.