The coupling of the electromagnetic field to gravity is discussed. In the premetric axiomatic approach based on the experimentally well established conservation laws of electric charge and magnetic flux, the Maxwell equations are the same irrespective of the presence or absence of gravity. In this sense, one can say that the charge "substratum" and the flux "substratum"are not influenced by the gravitational field directly. However, the interrelation between these fundamental substrata, formalized as the spacetime relation H = H(F ) between the 2-forms of the electromagnetic excitation H and the electromagnetic field strength F , is affected by gravity. Thus the validity of the equivalence principle for electromagnetism depends on the form of the spacetime relation. We discuss the nonlocal and local linear constitutive relations and demonstrate that the spacetime metric can be accompanied also by skewon, dilaton, and axion fields. All these premetric companions of the metric may eventually lead to a violation of the equivalence principle.