Ammonia won't work for this problem. To a cat it will smell like another cat's urine, so the resident cat marking his territory (spraying) will think it's a new scent he needs to cover up. It will likely make him spray more
You'll have to instead use something to make your yard distasteful and unattractive to him. There are repellents made for outdoor use, but you'll have to apply them daily or several times a week and that might get expensive if you have a large area to cover. If not, try a granulated form for outdoor use. Another neat product is the Cat Stop
device, it emits a sound that will send him running, but it is too high-pitched for humans to hear. It's over 50 bucks, though.
Mothballs pressed into the soil around your window areas might work, but you and everyone else will be able to smell them. If that's not a problem, then great...they're cheap and easy to get.
There are lots of ways to discourage him from marking around your windows, so you'll probably find an easy and humane way to stop him from stinking up your yard. Another possibility is to discuss with your neighbor the benefits of neutering him and keeping him inside should you get a chance to do that. It would be the all-around best solution for everyone involved, especially the cat.