Heal someone, recognize them as a spy, and then kill them.
Spycheck your heal target by walking into them while their back is turned or firing your needle gun at them. You and your projectiles can pass through teammates. The spy might also reveal themselves to kill a teammate.
I recommend using the needle gun to kill your spy. The spy has a better melee weapon than you, so a bonesaw attack is unwise.