Confirm this with your previous owner first.
How ?
Ask your agent ! There is a form that the agent should ask the previous owner to fill which should state all KNOWN existing/fixed issues related to house (but I'm not sure which will include stuff like this). The form is standard form cross Ontario, you can verify with any real state agency. And you should (I could be wrong).
If this is true (50% unlikely), then check your sale agreement first; I think you should ask previous owner to pay for this.
your "邻居" is a Chinese family ? I hope not. :flaming::blowzy:
Bottom line, you should not pay for this.
Ask my colleague about this and the common sense according to him is:
1. If the fence is in your neighbor's property, you are not allowed to attach your gate to your neighbor's fence post.
2. If the fence is on the property line, no matter who paid for it when it was first built, the fence itself is shared by you and your neighbor, meaning that you are allowed to attach your gate to the fence post. And generally you should not be asked to share the cost for building the fence, which was done before you moved in.