The answer is no in general.
Any surface of degree $d$ passing through the lines is of the form $l_1 Q_1+l_2Q_2$ where $Q_1,Q_2$ are homogeneous polynomials of degree $d-1$.
Since the line does not intersect the curve $C$, the curve $C$ is not in a plane passing through the line. Hence, neither $l_1$ neither $l_2$ vanishes on $C$. But this does not imply that $Q_1,Q_2$ vanish on $C$.
Let us give a precise example (sorry my previous one did not work because $C$ and $l$ were not empty, but this one is OK).
It suffices to choose a smooth cubic $S$ in $\mathbb{P}^3$, a line $l$ on it, and a curve $C$ on $S$ which does not intersect $l$ and which is not contained in any quadric. Then, the equation of $S$ if of the form $l_1Q_1+l_2Q_2$ where $Q_1,Q_2$ have degree $2$. BUT it is not possible to choose $Q_1,Q_2$ that vanish on $C$, since $C$ is not contained in any quadric.
It remains to see that such a curve $C$ exists; and in fact a general curve of $S$ will make the job. There exists a birational morphism $S\to \mathbb{P}^2$ which contracts $6$ lines of $S$ onto $6$ points of $\mathbb{P}^2$ in general position, and we can choose that $l$ is one of the lines contracted. Take then a curve of $\mathbb{P}^2$ of high degree (say $d>2$) Editnot: I gave an explicit counterample before passing through any of the $6$ points. The preimage on $S$ gives a curve $C$ on $S$ which does not intersect $l$. Moreover, but there wasthe degree of $C$ in $\mathbb{P}^3$ is the intersection with a mistakehyperplane section, corresponding to a cubic of $\mathbb{P}^2$ though the six points, and is thus $3d>6$. Since $C$ is contained in a smooth cubic, and has degree $>6$, it is not contained in a quadric.
PS: The same argument does not work in smaller degree, as observed by Mohani.e. if $S$ is a quadric. Indeed, the only curves in $S$ which do not intersect $l$ are lines, and are then contained in planes.