We analyse the dependence of the luminosity function (LF) of galaxies in groups on group dynamical state. We use the Gaussianity of the velocity distribution of galaxy members as a measurement of the dynamical equilibrium of groups identified in the Sloan Digital Sky Survey Data Release 7 by Zandivarez & Martínez. We apply the Anderson–Darling goodness-of-fit test to distinguish between groups according to whether they have Gaussian or non-Gaussian velocity distributions, i.e. whether they are relaxed or not. For these two subsamples, we compute the 0.1r-band LF as a function of group virial mass and group total luminosity. For massive groups, , we find statistically significant differences between the LF of the two subsamples: the LFs of groups that have Gaussian velocity distributions have a brighter characteristic absolute magnitude (∼0.3 mag) and a steeper faint-end slope (∼0.25). We detect a similar effect when comparing the LF of bright  Gaussian and non-Gaussian groups. Our results indicate that, for massive/luminous groups, the dynamical state of the system is directly related to the luminosity of its galaxy members.