If it’s a dog you think you can do this with out getting savaged. Lure him in with some food and then smear a big handful of deep heat all over his snout and nostrils.

It’ll eventually wear off and won’t do any damage, but it’ll be very wary of your place from then on.