By the very definition of a categorical product, $f_i = \pi_i \circ f$ where $f$ is the product of $f_1, f_2$, so it's always possible to recover the morphisms. If one of them is empty, for example $f_1 : Y \rightarrow X_1 \times X_2$ is empty, then it means that $Y = \varnothing$, and the other function must be the empty function too, and $f_1 \times f_2 = \varnothing$ too.
In general, if $Y$ is the initial object of $\mathcal{C}$ (like $\varnothing$ is the initial object of $\mathcal{Set}$), then in the commutative diagram defining the product, the morphisms $f_i : Y \rightarrow X_i$ are the only morphisms from $Y$ to $X_i$, and their product $f$ is the only morphism from $Y$ to the product of the $X_i$.