It's a great question, really. People want to know:
- Will the fence be built down the middle of the property line? (No, never.)
- If the fence must be on my property line, and I want to connect to my neighbor's fence on their property line, how does that work?
First of all, anyone building a fence will always, always want it to be constructed completely inside of their property line.
Even in situations where two neighbors agree to share the cost of a portion of fence that will be between their respective properties, it is still best that the fence be on one side or the other. This means of course that one particular neighbor owns the fence. That neighbor receives the value added to their home for having the fence. That neighbor gets the ultimate say-so in color choice (although neighbors usually agree on this or at least both stain the side facing their house the particular shade they like - although even doing so requires the permission of the fence owner). In addition to these upsides, come the downsides of being the responsible party. That owner is ultimately financially responsible for maintenance and repairs ... and this could be an issue if a major storm blows through the area and knocks a large tree down.
So hopefully, ultimately, these decisions are made between two neighbors who are able to discuss it and decide what, if anything, it's worth to them. If the decision is made to share the cost, the next step is realizing it does not have to be a 50/50 arrangement. Since one party will ultimately own the fence while both parties will practically get use out of the fence, it could be split up any which way the neighbors think is fair.
As far as how this can be accomplished, consider the graphic below. We can build a new fence parallel to the old one, but inside your own property line (while the old one should be just outside of your property line). This would leave a small gap at the end that, with your neighbor's consent, it's very easy to close up with a very small fence panel.