Probing and imaging spin interactions with a magnetic single-molecule sensor