Any methods such as an air rifle and others that cause pain are a manifestation of the originators' extreme idleness, put yourself in the place of the animal, shoot your own child, maybe something will light up in your head, the animal is not to blame for barking, it's his natural instinct, apparently something going wrong.
I wonder what would happen if I was shooting from my window at donkeys tearing their faces drunk at night.
There are appropriate institutions to deal with this, the police have legal grounds for this, you should first consult the animal rights institutions, the city and commune office knows who to contact, the dog may be sick or starved. If the neighbor is not bothered by barking and has a deep peace of others, there is nothing to caress, apparently it is a blunt "beetroot".
Stalking with an air rifle or putting drugs on drugs may end in prosecution and sentence for the abuse of animals.