Veterinary behavior bodies say aversive equipment including electronic collars should not be used. What that means when the real problem is your neighbor.
No law names the device, but pointing one at an animal you do not own creates cruelty, nuisance and trespass exposure. And you cannot see what it does.