Alternate name: FoF
The first video game about Friend-or-Foe indicator was released in 1995.
Commonly this appears as color change to the crosshair depending on what you're targeting (commonly red for enemies, green for allies and neutrals, white for no target, etc.), though it can exist in less obvious manner and in some cases even more obvious (e.g. silhouetting enemies somehow even when not being targeted).