Need Help Calling A Trigger Function

I have one prefab cube that is duplicated twice. These two duplicates are sitting next to each other (touching each other). I want the first cube to trigger the second only under certain circumstances. So the function OnTriggerEnter would not work because I need to place it in a if statement unless I’m missing something. Any help that could be given would be greatly appreciated. Thanks.

BTW, I did try raycasting (shooting a ray after the circumstances were right) but that will not work for my application.

You did make sure to set the box as triggers in the inspector, correct? OnTrigger will only work if so. If you want to, post the code you are using, and explain what type of colliders you are using on these objects/prefabs.