Level-Crossing Detection By Photon Statistics