The contract would be void so you just need to tell the parties to the contact this is your position.
In terms of stopping the neighbour encroaching, send them a cease and desist letter to warn them of your intentions unless they stop (and give them 7 days to stop their conduct). A template “cease and desist” letter is available at www.lawdepot.co.uk. You can use your own letter if you wish - it just has to make it clear this is a cease and desist letter, that you demand they stop their conduct, and that if they do not within 7 days you will apply to the court for the injunction and seek your costs.
That letter may well be enough to stop the conduct - as an injunction is a serious legal remedy.
Assuming they continue, you will need to complete the attached N208 claim form (to start proceedings) and the application for an injunction N16a form and send to your county court with a fee of £308 payable to HMCTS (unless you have a low income/low savings and/or you are in receipt of benefits in which case you can get a fee exemption so you do not have to pay).
For a fee exemption you need to also send to the court form EX160 (also attached). If you do not qualify for the fee exemption, you can pay either by cheque or attend the court and pay at the counter. You will need to prepare a witness statement to accompany the form. A template is attached for you to use.
You will need to detail the history of the issues with the neighbour to paint a picture for the Judge as they will not know what this neighbour is like unless you describe it.
If the injunction application is successful you can ask the court for a costs order to be paid by the neighbour.
The court will list a hearing where you attend and ask the District Judge for an order and the injunction.
If granted, the Order is then served on the individual concerned and they are bound by the court order - if they breach the order, they are in contempt of court and could well face a fine and a prison term.
If you want to draft the application then I can check it before you send it. The cease and desist letter may work so you may not need to apply but if you do, come back here and I will gladly check it for you.
I recommend you go to the court in person with the forms to ensure they are correct - they are fairly complex so it would save time by you doing this - the court staff should check them before they issue the papers.
I hope this helps - if you can please accept the answer and give me a 5 star rating (there should be a button at the top of your screen to do this), I can answer follow up Q&A's at no extra charge and Just Answer will credit me for helping you today.