Discussions about Dispel Magic seem to imply that as long as you can perceive a magic effect in range of the spell, you can try and dispel it.
See Can the Dispel Magic spell end a Darkness spell? and this quote from @Miniman:
knowing where it is means that you know where it is. This allows you to use spells like Dispel Magic to remove its invisibility.
But what if you can’t perceive it?
Two scenarios come in mind:
In combat, an evil wizard casts Invisibility on himself, walks away from the fray and uses the hide action on his next turn. Since PCs know/assume/deduce he’s invisible and certainly in range of the spell, can one use Dispel Magic to end the spell?
PCs enter a 80’×80′ room. Can one declare: “I dispel any Invisibility spell in range”, thus revealing one (the closest?) invisible enemy in the room?
What’s enough to enable a caster to cast Dispel Magic on a magic effect:
- perceiving (seeing, hearing, smelling, etc.) it?
- knowing/assuming/deducing it’s there?
- or merely suspect/predict it?