Let $S_0[\phi]$ be the action for a real Klein-Gordon field $$S_0[\phi]=\dfrac{1}{2}\int d^Dx \phi(x)(\Box-m^2)\phi(x)\tag{1}.$$
If we try to construct the generating functional $Z_0[j]$ we find that we must invert the operator ${\cal D}=\Box-m^2$. In other words we must find $\Delta(x-y)$ which obeys $$(\Box-m^2)\Delta(x)=\delta(x)\Longrightarrow -(k^2+m^2)\hat{\Delta}(k)=1\tag{2},$$ where we transformed the equation to Fourier space. Now since we are in Lorentzian signature we can have $k^2\leq 0$. Indeed it is possible that $k^2=-m^2$. This makes it ambiguous on how to define $\Delta(x)$ since we will eventually integrate over all $k$ and there will be values of $k$ on which the denominator of the integrand vanishes. This is of course solved with the $i\varepsilon$ prescription.
Now, consider instead $S_0^E[\phi]$ the Euclidean action in Euclidean singature. If we follow the same steps now ${\cal D}$ is replaced with ${\cal D}^E=\nabla^2-m^2$. The thing is that now this operator has no ambiguity in its inverse. The point is that if we repeat equation (2) now since the signature is Euclidean $k^2>0$. We have $$\hat{\Delta}_E(k)=-\dfrac{1}{k^2+m^2}\tag{3}\Longrightarrow \Delta_E(x-y)=-\int\dfrac{d^D k}{(2\pi)^D}\dfrac{e^{ik(x-y)}}{k^2+m^2}$$ and there is no ambiguity because the integrand is well-defined in the whole integration region.
My question here is this: suppose we start with the Euclidean two-point function $\Delta_E(x-y)$ and use analytic continuation to define the Lorentzian $\Delta(x-y)$. How does analytic continuation produce the $+i\varepsilon$ prescription? Moreover, how can one, starting from the Euclidean version, arrive at different prescriptions for the inverse of (2), like for instance $-i\varepsilon$?