The

my.ZNEAR = ON;
set(my,ZNEAR);

commands might be able to pull this off

taken directly from the manual

"If this flag is set, the MaxZ value of the D3D viewport is temporarily reduced by the d3d_near_models or d3d_near_sprites factor, depending on the type of the entity. Adjust the factors for fine-tuning the clipping".

dont quote me on this working as you hoped. but i remember accidently setting this flag on the wrong model and i could see it through the walls