Europe Rulebook, page 13:
Air units attacking territories that have antiaircraft guns will be fired upon. This doesnâ€™t include territories containing antiaircraft guns that are only being flown over.
Europe Rulebook, page 26:
An antiaircraft gun can only fire at an air unit when that unit attacks the territory containing that antiaircraft gun.