Consider in $\mathbb{A}^2(\mathbb{F}_q)$ two $\mathbb{F}_q$-rational curves $\mathcal{X}:f(x,y)=0$ and $\mathcal{Y}:g(x,y)=0$, and let $\mathcal{Y}$ be absolutely irreducible. Suppose also that $\emptyset\ne \{P\in\mathbb{A}^2(\mathbb{F}_q)\,:\,g(P)=0\}=V(g)\subseteq V(f)$, i.e. all the $\mathbb{F}_q$-rational points of $\mathcal{Y}$ also belong to $\mathcal{X}$. When is it possible to say that $g(x,y)$ divides $f(x,y)$ ($\mathcal{Y}$ is a component of $\mathcal{X}$)?
I already known from Bézout theorem (applying it in the projective plane defined over the algebraic closure of $\mathbb{F}_q$) that this holds when the number of $\mathbb{F}_q$-rational points of $\mathcal{Y}$ strictly lower than $\deg(f)\cdot\deg(g)$. Do there exist some other (less restrictive?) conditions for making this happen?
Example: Take $\mathbb{F}_q$ as a field of characteristic $p\ge 5$ and consider $\mathcal{Y}$ as an elliptic curve defined by its Weierstrass equation, i.e. $g(x,y)=y^2-x^3-ax-b$ for given $a,b\in\mathbb{F}_q$, having $N:=|\mathcal{Y}(\mathbb{F}_q)|$ $\mathbb{F}_q$-rational points. We also know from Hasse bound that $|N-(q+1)|\le 2\sqrt{q}$. If I have another curve $\mathcal{X}:f(x,y)=0$ which annihilates on all those $N$ points, is it possible to say that $y^2-x^3-ax-b\, |\, f(x,y)$ when $N\le 3\cdot \deg(f)$?