I have not, as usaul, read any other replies so plesae excuse me if I repeat or offend - it is not meant!

This is the only reason, in my opinion, to buy a flexi- lead.

If your neighbour is willing then this is what I suggest. Get a retractable lead and leave your dog with your neighbour as often as possible. Make this very short periods at first - 10 minutes. Allow the dog to be several feet away from the neighbour, on the lead. During this time you either get in the car and disappear or go for a walk but make it clear - without taking notice of the dog- that you are no longer in the area.
The neighbour , also, takes no notice what-so-ever of the dog, no matter what the dog does. This means no looking at, speaking to or touching the dog. Get your neighbour to read a book, knit, sew or pretend to take a nap.
When you return it is vital that you ignore the dog - it will, no doubt, be jumping all over you!!
Speak to your neighbour until the dog realises that it is going to get nothing for behaving like it is. As soon as the dog is calm - go home - still not taking any notice of the dog.
When you get home you must continue to be strong - only notice the dog when it is doing what you want it to do.......lying down calmly. Then, calmly, praise the dog and maybe have a game or take it for a walk.

As time goes on get the neighbour to shorten the length on the lead - still without taking notice of the dog, and you spend longer away.

The first time the dog asks for attention from your neighbour he MUST ignre it!

He can then call the dog to him and make a fuss of the dog when it responds - the dog will then have learned to trust you to come back and the neighbour not to hurt him.