If $F$ is continuously differentiable and smooth, you can use the gradient to walk along the contour. In this way you could walk on the contour starting at $x_1$ (tracing both directions of the contour) and see if you reach $x_2$.
In particular, if you're currently at a point $x \in \mathcal{C}$ on the contour, then the gradient $\nabla F(x)$ tells you what direction to walk if you want to stay on the contour: you should walk in the direction $(\nabla F(x))^\perp$, where we define $(a,b)^\perp = (b,-a)$. (In other words, you should walk in the direction perpendicular to the gradient.) In particular, when $\epsilon$ is sufficiently small, $x + \epsilon \cdot (\nabla F(x))^\perp$ will be approximately on the contour. This is because $\nabla F(x)$ points in the direction that most increases $F$, and if we're on a contour and the contour is a line, $\nabla F(x)$ points in a direction perpendicular to that contour. (See, e.g., https://math.stackexchange.com/q/599488/14578.)
So in principle if the contour was a simple line (whether closed or open), the following would be sufficient: start at $x_1$ and walk in one direction and see if you eventually reach $x_1$. In parallel, start at $x_2$ and walk in the other direction and see if you eventually reach $x_2$.
In practice there are two complications.
First, the contour is curved, so the gradient only helps you walk in a direction that is approximately along the contour -- but maybe not exactly. So, I suggest a refined way to walk at the contour. At you're currently at the point $x$, first to the point $x' = x + \epsilon \cdot (\nabla F(x))^\perp$. The point $x'$ might not be exactly on the contour, but it'll probably be close. Next, use gradient descent starting at $x'$ to find a point on the contour that is close to $x'$. If $F$ is everywhere positive, you might do this by minimizing the objective function $\Phi(x'') = F(x'') + c \cdot \|x''-x'\|^2$ where $c>0$ is a sufficiently small constant; otherwise, you can use $\Phi(x'') = F(x'')^2 + c \cdot \|x''-x'\|^2$. If you have a better way to find the nearest point on the contour, go ahead nad use that. Finally, walk to this point $x''$. This gives you an adjacent point on the contour, that's approximately distance $\epsilon$ away from where you started. Repeat this.
The second complication is that the contour might not be a simple line; there might be places where two or more lines meet at an intersection. At this point, $F$ won't be differentiable and the gradient might not be computable or meaningful. You'll have to figure out how to detect that situation; perhaps you can use your domain knowledge about $F$ to help you detect that. If you have no other ideas, one possibility is to pick a dozen random points in the neighborhood of $x$, project each one to the nearest point on the contour, check the gradient, and see if all of them seen consistent with a single nearly-straight line or whether their appear to be multiple lines converging. Once you detect an intersection point, you can use depth-first search (basically, explore all directions out of the intersection point) to traverse the connected component -- then it reduces to the problem of checking whether two vertices in an undirected graph are in the same connected component, and that can be done using DFS.
This uses techniques that are quite similar to that proposed in my answer to your previous question on a 3D version of this situation.