probably a box search would be the best option
just put it at the position and make the size slightly less than the size of the brick (making the size the same will detect bricks around the brick as well)
if for w/e reason this doesn't work for you you can probably also use upbrick/downbrick loops but this has obvious issues with it