Suppose you have basepoints $x_0\in X$, $z_0\in Z$ and $p(x_0)=f(z_0)$. The lift $\tilde{f}:Z\to X$ such that $p\circ \tilde{f}=f$ exists and is continuous if and only if
$f_{\ast}(\pi_1(Z,z_0))\subseteq p_{\ast}(\pi_1(X,x_0))$ and
For every evenly neighborhood $U\subset Y$, there is an open neighborhood $V\subset Z$ such that if $\alpha,\beta:([0,1],0)\to (Z,z_0)$ are paths with $\alpha(1),\beta(1)\in V$, then the lifts of $f\alpha$ and $f\beta$ starting at $x_0$ end in the same slice of $U$ in $X$.
For arbitrary spaces, this is about as good as it gets. Without more conditions on $Z$ to control how paths vary with respect to their endpoints, there is no way to get around having to deal with how the given cover lifts paths. There are some conditions that do provide insight for some non-locally path connected spaces.
Here is a necessary condition which generalizes local path-connectivity:
Suppose $(PZ)_{z_0}$ the space of paths in $Z$ starting at $z_0$ with the compact-open topology and $ev:(PZ)_{z_0}\to Z$, $ev(\alpha)=\alpha(1)$ is endpoint-evaluation.
Theorem: If $f_{\ast}(\pi_1(Z,z_0))\subseteq p_{\ast}(\pi_1(X,x_0))$ and $ev:(PZ)_{z_0}\to Z$ is a quotient map, then $\tilde{f}$ exists and is continuous.
For a proof, see Lemma 2.5 and Corollary 2.6 of
J. Brazas, Semicoverings, coverings, overlays and open subgroups of the quasitopological fundamental group, Topology Proc. 44 (2014) 285-313.
The proof doesn't even require using local triviality. To see an example of this generalization in action, consider something like the suspension of zero-dimensional space. This is not locally path connected, but the evaluation map is quotient so lifts are guaranteed to be continuous.