We extend an inequality for harmonic functions, obtained in Magnanini and Poggesi (Calc Var Partial Differ Equ 59(1):Paper No. 35, 2020) and Poggesi (The Soap Bubble Theorem and Serrin’s problem: quantitative symmetry, PhD thesis, Università di Firenze, 2019), to the case of solutions of uniformly elliptic equations in divergence form, with merely measurable coefficients. The inequality for harmonic functions turned out to be a crucial ingredient in the study of the stability of the radial symmetry for Alexandrov’s Soap Bubble Theorem and Serrin’s problem. The proof of our inequality is based on a mean value property for elliptic operators stated and proved in Caffarelli (The Obstacle Problem. Lezioni Fermiane. [Fermi Lectures]. Accademia Nazionale dei Lincei, Rome; Scuola Normale Superiore, Pisa, 1998) and Blank and Hao (Commun Anal Geom 23(1):129–158, 2015).