  We calculate the double-virtual $\eta \rightarrow \gamma^* \gamma^*$
transition form factor $\mathcal{F}_{\eta \to \gamma^* \gamma^*}(q_1^2,q_2^2)$
from first principles using a lattice QCD simulation with $N_f=2+1+1$ quark
flavors at the physical pion mass and at one lattice spacing and volume. The
kinematic range covered by our calculation is complementary to the one
accessible from experiment and is relevant for the $\eta$-pole contribution to
the hadronic light-by-light scattering in the anomalous magnetic moment $a_\mu
= (g-2)/2$ of the muon. From the form factor calculation we extract the partial
decay width $\Gamma(\eta \rightarrow \gamma \gamma) =
323(85)_\text{stat}(22)_\text{syst}$ eV and the slope parameter
$b_\eta=1.19(36)_\text{stat}(16)_\text{syst}$ GeV${}^{-2}$. For the $\eta$-pole
contribution to $a_\mu$ we obtain $a_\mu^{\eta-\text{pole}} =
13.2(5.2)_\text{stat}(1.3)_\text{syst} \cdot 10^{-11}$.
