Optical readout of the chemical potential of two-dimensional electrons