Let $A=[a_{i,j}],B=[b_{i,j}],X=[v_i],Y=[w_i]$. When a solution exists, necessarily,
i) for every $i$, $a_{i,i}=0 \implies b_{i,i}=0$.
ii) for every $i,j$, $a_{i,j}=a_{j,i}=0 \implies b_{i,j}=b_{j,i}=0$.
Assume that we consider generic matrices $A,B$ (for example, randomly choose them). Then, with probability $1$, the $(a_{i,j}),(b_{i,j})$ are non-zero and the conditions i),ii) are fulfilled. In particular, the $(v_i),(w_i)$ are non zero and we can put $v_1=1$ (if $(X,Y)$ is a solution, then $(aX,1/aY)$ too).
Thus one considers a system of $\dfrac{n(n+1)}{2}+1$ equations in the $2n$ unknowns $(a_{i,j}),(b_{i,j})$. As noted by obareey, the system is overdetermined for $n$ large enough.
Indeed, we can show that the equations are algebraically independent (when $A,B$ are generic); then (if we want that there is at least one solution) we must find $r_n=\dfrac{n(n+1)}{2}+1-2n=\dfrac{(n-1)(n-2)}{2}$ relations linking the $(a_{i,j}),(b_{i,j})$.
For example, we randomly choose $B$ and $n^2-r_n$ entries of the matrix $A$. Then one has $r_n$ supplementary unknowns.
For $n=2$, no problem. For $n=3$, $r_3=1$. For $n=4$, $r_4=3$.
That follows is an example for $n=4$. $u1,u2,u3$ are the $3$ supplementary unknowns.

One of the solutions for $u1,u2,u3$

The associated solution $(X,Y)$.
