Whenever I walk my dogs, I carry one of these along with one of these, mainly since one of my dogs was attacked by an unleashed German Shepherd back in 2020 (luckily we got her out of his mouth before he did any damage).
A few months ago I had to use the spray on an unleashed Doberman that ran up to our dogs aggressively. Doberman's owner had to rush it to the vet... Hopefully he learned his lesson.
Just let your neighbor know that if their dog comes into your yard again, it might not make it home. There are way too many irresponsible dog owners out there.