I) Not all equations of motion (eom) are variational. A famous example is the self-dual five-form in type IIB superstring theory. In classical point mechanics, frictional forces typically lead to non-variational problems.
II) Consider for instance $n$ variable $q^i$ and $n$ eoms,
$$\tag{1} E_i~\approx~ 0, \qquad i~\in~\{1, \ldots, n\}. $$
A simplified version of OP's problem (v3) is the following:
Does there exist an action $$\tag{2} S[q] ~=~\int{\rm d}t~L$$ such that the Euler-Lagrange derivatives $$\tag{3} \frac{\delta S}{\delta q^i}~=~E_i $$precisely become the given $E_i$-functions?
The above restricted problem is relatively easy to answer once and for all, because one may differentiate the known $E_i$-functions to arrive at a set of consistency conditions. Let us for simplicity assume that the functions $E_i=E_i(q)$ do not involve generalized velocities $\dot{q}^i$, accelerations $\ddot{q}^i$, and so forth. Then we may assume that the Lagrangian $L$ does not depend on time derivatives of $q^i$ as well. So the question becomes if
$$\tag{4} \frac{\partial L}{\partial q^i}~=~E_i ? $$
We can collect the information of the eoms in a one-form
$$\tag{5} E~:=~E_i ~{\rm d}q^i.$$
The question rewrites as
$$\tag{6} {\rm d}L~=~E? $$
Hence the Lagrangian $L$ exists if $E$ is an exact one-form.
III) However, the above discussion is in many ways oversimplified. The eoms (1) do not have a unique form! E.g. one may multiply the given $E_i$-functions with an invertible $q$-dependent matrix $A^i{}_j$ such that the eoms (1) equivalently read
$$\tag{7} \sum_{i=1}^n E_i A^i{}_j~\approx~ 0. $$
Or perhaps the system variables $q^i$ should be viewed as a subsystem of a larger system with more dynamical or auxiliary variables?
Ultimately, the main question is whether the eoms have an action principle or not; the particular form of the eoms (that the Euler-Lagrange equations spit out) is not important in this context.
This opens up a lot of possibilities, and it can be very difficult to systematically find an action principle; or conversely, to prove a no-go theorem that a given set of eoms is not variational.