You can make attacking unit's owner treat the other one's owner as allied (change owner if needed)
Or you can disable attack ability for attacking unit while standing close to ignored unit (you can disable attack by using a spell based on Silence for example, or Cargo)
Dunno if it helps!