You have to use a raycast to do this. I personally have had issues with normal raycasts, so I like to use box raycasts.
function getBrickAtPos(%pos)
{
initContainerBoxSearch(%pos, "0.4 0.4 0.2", $typeMasks::FxBrickAlwaysObjectType);
%brick = containerSearchNext();
if(isObject(%brick))
return %brick;
return 0;
}