Under some conditions we can do this without a line integral. Let's assume that $\varphi$ is once continuously differentiable, so $f$ and $g$ are continuous as functions of $(x,y)$. Indefinite integration of $f(x,y)$ in $x$ gives $$\int f(x,y)dx = F(x,y)+\eta(y),$$ where $$\frac{\partial}{\partial x}F(x,y) = f(x,y).$$ Such $F$ exists by continuity of $f$ as a function of $(x,y)$. $\eta(y)$ is like the constant you get out in single-variable indefinite integration, but in multiple variables you need to account for the $y$. Differentiating $F+\eta$ in $x$ will yield $f(x,y)$ since $\eta$ is independent of $x$, so $\eta_x=0$. By a similar argument we conclude that $$\int g(x,y)dy = G(x,y)+\mu(x),$$ where $$\frac{\partial}{\partial y}G(x,y)=g(x,y).$$
$\varphi$ is an antiderivative of $f$ in the variable $x$, so it is equal to $F(x,y)+\eta(y)$ for some function $\eta$ in $y$. Similarly it is equal to $G(x,y)+\mu(x)$ for some function $\mu$ in $x$. Under some circumstances this is enough to describe $\varphi$. For example:
Suppose $\frac{\partial \varphi}{\partial x} = 2xy$, $\frac{\partial \varphi}{\partial y}=x^2$. Then $\varphi(x,y) = x^2y+\eta(y)$ for some function $\eta$ in $y$, and $\varphi(x,y)=x^2y+\mu(x)$ for some function $\mu$ in $x$. Subtracting these two equations, we find that $\eta(y)-\mu(x)=0$, and since these two functions are independent of each other this must mean $\eta$ and $\mu$ are constant and equal to one another. Therefore we conclude that $\varphi(x,y)=x^2y+C$ for some constant $C$. (This is a very simple example; this sort of problem is usually much harder.)
In general the nature of the $\mu$ and $\eta$ (and therefore $C$, if such a constant is involved) is determined by the value of $\varphi$ at particular points, much like an initial value problem. The procedure I outlined here generalizes to more than two variables - for instance, indefinitely integrating a sufficiently smooth $h(x,y,z)$ in $x$ gives us $$\int h(x,y,z) dx = H(x,y,z)+\xi(x,y),$$ i.e. an "antiderivative" and a "constant," i.e. an independent function.
Moral: indefinite integration of a real-valued function of several variables is just like single variables, but the "constants of integration" are "functions of integration" instead.