One bark next door and yours answers from the living room. Dogs may respond to other dogs' calls even without seeing them. Some are curious or excited, others become worried or alert. The bark itself does not tell you which.
Notice where your dog is when it starts. If they are stationed by the shared wall, window, or fence, help them rest somewhere quieter. Soft background sound may mask a little of the barking if your dog likes it. Keep them inside when you cannot supervise fence-side time. Yelling "quiet" over two dogs often adds another loud voice to the exchange.
Reward the turn away
Practice a simple "come here" or "find it" game in a calm room. Scatter a few treats on the floor and let your dog sniff. When a distant bark starts and your dog is still able to respond, invite them away from the window and reward. If they cannot turn from the sound, move farther from it and try an easier moment later. Ask for a short pause, not a silent performance through an hour of neighborhood barking.
If your dog barks only when left alone, that may be a different issue and a recording could help distinguish separation distress from a sound trigger. Sudden, severe, or persistent noise sensitivity is worth discussing with your veterinarian. You may not be able to control the neighbor's dog, but you can change what happens on your side of the wall. If barking from other dogs repeatedly winds yours up, the barking and reactivity guide offers a broader plan for triggers, start with a quieter resting place
Sources: ASPCA: Barking - socially facilitated barking. Dogs Trust: How to stop your dog barking.