Or neither?
The inverse square law is applied to the surface brightness of a galaxy, based on a telescope receiving energy per unit area of aperture.
Thus shining a flashlight on a screen is the inverse of a galaxy shining its light on a telescope aperture on Earth.
How do we know whether this is true?
Reference: p. 29, Surface brightness fluctuations, in Weinberg, S. Cosmology 2008 Oxford Univ. Press.