Sensing the Local Magnetic Environment through Optically Active Defects in a Layered Magnetic Semiconductor