Rogue sneak attack and what does it mean to be an enemy?

The Rogue can sneak attack if another enemy of the target is within 5 feet of it. What constitutes being an enemy – Hostile intent or hostile actions or just being a passive ally?

  1. An ally of the rogue has the Sanctuary spell up and is within 5 feet of the enemy. The Sanctuary spell continues as long as the warded ally does not attack or casts an attack spell (and maintains concentration). Assuming the warded ally does not attack, would it be considered an enemy for enabling the rogue’s sneak attack?
  2. An ally of the rogue has Gaseous Form active and is within 5 feet of the enemy. Gaseous Form does not allow the ally to attack. Does this enable sneak attack?
  3. What if the ally is a warlock with Cloak of Flies active and damaging the enemy?