Feynman $i\varepsilon$-prescription in path integral by adding an imaginary part to time It is known that the well-definiteness of the path integral leads to the Feynman's $i\varepsilon$-prescription for the field propagator. I've found many ways of showing this in the literature, but it is precisely the way that I have learned in my QFT course (and which I have not found in literature) that I do not understand. 
Context of the problem
Considering the case of a real scalar field for simplicity, one has that the following path integral (evaluated at asymptotic times)
\begin{equation}
\lim_{T \rightarrow \infty}\int_{\phi(-T, \vec{x})}^{\phi(T,\vec{x})}  \mathcal{D}\phi \ \text{exp} \left( i \int^T_T dt \int d³ x \ ( \mathcal{L}+J \phi) \right)\tag{1}
\end{equation}
can be expressed as
\begin{equation}
\lim_{T \rightarrow \infty} \sum_{m, n} e^{-i\left(E_n+E_m \right)T} <\phi, T|n, T>_J <n|m>_J <m,-T|\phi, -T>\tag{2}
\end{equation}
where $|n>_J$ are eigenstates of the hamiltonian $H$ in the pressence of the source $J$. In order to make this oscillatory exponential converge (and properly define the path integral) one adds to $T$ a small imaginary part $T \rightarrow T(1-i\varepsilon)$. With this, one writes the vacuum persistence amplitude as 
\begin{equation}
<0|0>_J = \frac{1}{N} \lim_{\varepsilon \rightarrow 0} \  \lim_{T \rightarrow \infty(1-i\varepsilon)} \int \mathcal{D} \phi \ \text{exp} \left( i \int_{-T}^T dt \int d³x (\mathcal{L}+J\phi)\  \right) \equiv \frac{1}{N} Z[J]\tag{3}
\end{equation}
where the constant $N$ is typically taken to be $N=Z[0]$.
My problem
In order to relate $Z[J]$ with the Feynman propagator $D_{F}(x-y)$, one typically writes the argument of the exponential in the Fourier space, then makes the change of variable $$\hat{\phi}(p)'=\hat{\phi}(p)+(p²-m²)^{-1} \hat{J}(p)\tag{4}$$ (which leaves $\mathcal{D}\phi'=\mathcal{D}\phi$) to get
\begin{equation}
Z[J]=Z[0] \text{exp} \left(-\frac{i}{2} \int \frac{d⁴ p}{(2\pi)⁴} \hat{J}(p) \frac{1}{p²-m²} \hat{J}(-p)\right).\tag{5}
\end{equation}
Here I'm using the $(+,-,-,-)$ Minkowski sign convention.
Now here I've been told that the fact of replacing $T\rightarrow (1-i\varepsilon)T$ to define the path integral is equivalent in Fourier space as $p⁰ \rightarrow (1+i\varepsilon)p⁰$. With this, one gets the correct $i \varepsilon$ Feynman prescription for the propagator $D_F(x-y)$
\begin{equation}
Z[J]=Z[0] \text{exp} \left(-\frac{i}{2} \int \frac{d⁴ p}{(2\pi)⁴} \hat{J}(p) \frac{1}{p²-m²+i\varepsilon} \hat{J}(-p) \right) = Z[0] \text{exp} \left(-\frac{1}{2} \int d⁴y \int d⁴x \ J(x) D_F(x-y) J(y)  \right). \tag{6}
\end{equation}
And this is the part that I don't get at all, I've tried but I don't see how the fact that $T\rightarrow (1-i\varepsilon)T$ leads in the previous approach to $p⁰ \rightarrow (1+i\varepsilon)p⁰$ and therefore to the Feynman prescription. I'm having nightmares with this, any help would be really appreciated.
NOTE: I use the following convention for the Fourier transform
\begin{equation}
\hat{\phi}(p)=\int d⁴ x \ \phi(x) e^{-ip \cdot x}\tag{7}
\end{equation}
so that
\begin{equation}
\phi(x)= \int \frac{d⁴p}{(2 \pi)⁴} \ \hat{\phi}(p) e^{+ip \cdot x}.\tag{8}
\end{equation}
 A: *

*In this answer we would like to understand the Wick rotation as an analytic continuation, i.e. as an (almost) $90^{\circ}$ continuous rotation in the complex plane. The before and after scenario is not enough: We would like to trace every step along the way of the Wick rotation.


*Advice: Use the $(-,+,+,+)$ Minkowski signature convention$^1$, cf. my Phys.SE answer here. [The opposite sign convention is also possible but there are more surprises in store along the way.]


*The Feynman $i\epsilon$-prescription can be viewed as stopping the Wick rotation just before a full $\frac{\pi}{2}$-rotation in the complex plane, cf. my Phys.SE answer here.


*The Wick rotation treats in principle all contravariant 4-vectors the same way. (However, see section 8 below!) In particular, time $x^0$ and energy $p^0$ rotate in the same direction, cf. my Phys.SE answer here.
$$\begin{align}
x^0_E~=~&ie^{-i\epsilon}x^0_M, \cr 
p^0_E~=~&ie^{-i\epsilon}p^0_M. 
\end{align}\tag{A}$$
This means that covariant components, such as e.g. $p_0$, rotate in the opposite direction.
$$p_0^M~=~ie^{-i\epsilon}p_0^E .\tag{B}$$
In particular, the metric component $g_{00}$ rotates twice as fast in the opposite direction.
$$\begin{align} g_{00}^M~=~& -e^{-2i\epsilon}g_{00}^E, \cr  g_{00}^E~=~&1.\end{align}\tag{C}$$


*Let us for simplicity consider a real scalar field. The Fourier transform (and inverse Fourier transform) read
$$\begin{array}{rcl}
\widetilde{\phi}_{\! M}(k_M)&=&\int \! d^4x^{\bullet}_M ~e^{-ik_M \cdot x_M}\phi(x_M),\cr
\phi(x_M)&=&\int \! \frac{d^4k_{\bullet M}}{(2\pi)^4}~e^{ik_M \cdot x_M}\widetilde{\phi}_{\! M}(k_M) \cr 
\widetilde{\phi}_{\! E}(k_E)&=&\int_{\mathbb{R}^4} \! d^4x_E ~e^{-ik_E \cdot x_E}\phi(x_E)\cr
&=& ie^{-i\epsilon}\widetilde{\phi}_{\! M}(k_M), \cr
\phi(x_E)&=&\int_{\mathbb{R}^4} \! \frac{d^4k_E}{(2\pi)^4}~e^{ik_E \cdot x_E}\widetilde{\phi}_{\! E}(k_E)\cr
&=&\phi(x_M).\end{array}\tag{D}$$
The bullet $\bullet$ in the integration measure indicates the position the spacetime index.


*We want to perform the Gaussian integration in the Euclidean formulation:
$$\begin{align} Z_0[J]
=~~~~~&\int\! {\cal D}\phi \exp\left\{ \frac{i}{\hbar}\int \! d^4x^{\bullet}_M \left( \rule[1.5ex]{0ex}{1ex} J(x_M)\phi(x_M)\right.\right.\cr 
& \qquad\qquad \left.\left.+\frac{1}{2}\phi(x_M)(\Box_M-m^2/\hbar^2 +i\epsilon)\phi(x_M)   \right)\right\}\cr
\stackrel{x^0_E=ie^{-i\epsilon}x^0_M}{=}&\int\! {\cal D}\phi \exp\left\{ \frac{1}{\hbar}\int_{\mathbb{R}^4} \! d^4x_E \left( \rule[1.5ex]{0ex}{1ex}J(x_E)\phi(x_E)\right.\right.\cr 
& \qquad\qquad \left.\left.- \frac{1}{2}\phi(x_E)(-\Box_E+m^2/\hbar^2)\phi(x_E)   \right)\right\}\cr
\stackrel{\text{Gauss. int.}}{\sim}&\exp\left\{ \frac{1}{2\hbar}\int_{\mathbb{R}^4} \! d^4x_E ~ J(x_E)\frac{1}{-\Box_E+m^2/\hbar^2}J(x_E)   \right\}\cr
\stackrel{\text{Fourier}}{=}~~&\exp\left\{ \frac{1}{2\hbar}\int_{\mathbb{R}^4} \! \frac{d^4k_E}{(2\pi)^4} ~ \frac{\widetilde{J}_{\! E}(k_E)\widetilde{J}_{\! E}(-k_E)}{k^2_E+m^2/\hbar^2}\right\}.
\end{align}\tag{E}$$
Here is an alternative derivation of the same:
$$\begin{align} Z_0[J]
=~~~~~&\int\! {\cal D}\phi \exp\left\{ \frac{i}{\hbar}\int \! d^4x^{\bullet}_M \left( J(x_M)\phi(x_M)\right.\right.\cr 
& \qquad\qquad \left.\left.+\frac{1}{2}\phi(x_M)(\Box_M-m^2/\hbar^2 +i\epsilon)\phi(x_M) \right)\right\}\cr
\stackrel{\text{Fourier}}{=}~~&\int\! {\cal D}\phi ~\exp\left\{ \frac{i}{2\hbar}\int \! \frac{d^4k_{\bullet M}}{(2\pi)^4} \left(\widetilde{J}_{\! M}(-k_M)\widetilde{\phi}_{\! M}(k_M)\right.\right.\cr
& \qquad\qquad+\widetilde{J}_{\! M}(k_M)\widetilde{\phi}_{\! M}(-k_M) \cr 
& \qquad\qquad \left.\left. -\widetilde{\phi}_{\! M}(k_M)(k^2_M+m^2/\hbar^2 -i\epsilon)\widetilde{\phi}_{\! M}(-k_M)\right)\right\} \cr
\stackrel{\text{Gauss. int.}}{\sim}&\exp\left\{ \frac{i}{2\hbar}\int \! \frac{d^4k_{\bullet M}}{(2\pi)^4} ~ \frac{\widetilde{J}_{\! M}(k_M)\widetilde{J}_{\! M}(-k_M)}{k^2_M+m^2/\hbar^2 -i\epsilon}\right\}\cr
\stackrel{k^M_0=ie^{-i\epsilon}k^E_0}{=}&\exp\left\{ \frac{1}{2\hbar}\int_{\mathbb{R}^4} \! \frac{d^4k_E}{(2\pi)^4} ~ \frac{\widetilde{J}_{\! E}(k_E)\widetilde{J}_{\! E}(-k_E)}{k^2_E+m^2/\hbar^2}\right\}.\end{align}\tag{F}$$


*To raise the bullet $k^M_0=-k^0_M$ in the Fourier transform (D) or in the second last expression of eq. (F) cost a minus sign, which we remove again by implicitly interchanging the corresponding integration limits:
$$~=~\exp\left\{ \frac{i}{2\hbar}\int \! \frac{d^4k^{\bullet}_M}{(2\pi)^4} ~ \frac{\widetilde{J}_{\! M}(k_M)\widetilde{J}_{\! M}(-k_M)}{k^2_M+m^2/\hbar^2 -i\epsilon}\right\}.\tag{G}$$
Warning: Interchanging integration limits in Minkowskian formulation implies interchanging integration limits in the Euclidian formulation.


*In the rest of this answer we consider a formulation in momentum space where the metric $g^M_{00}=-1$ is kept fixed without a rotation a la eq. (C). The Minkowski propagator has
$$\begin{align} \text{denominator} 
~~=~&p^2_M+m^2 -i\epsilon \cr
~=~& -(p^M_0)^2+\omega_{\bf p}^2-i\epsilon,\end{align}\tag{H} $$
and therefore poles at
$$\begin{align} 
-p_M^0~=~& p^M_0~=~\pm(\omega_{\bf p}-i\epsilon), \cr 
\omega_{\bf p}~:=~&\sqrt{{\bf p}^2+m^2}~\geq~0,
\end{align}\tag{I}$$
in the complex $p^M_0$ plane.
$\downarrow$ Figure from Ref. 1.

The covariant $p^M_0$ poles are not crossed during the Wick rotation (B), but the contravariant $p^0_M$ poles are crossed during the Wick rotation (A). Therefore, to get a consistent formulation for contravariant $p^0$, we should do an opposite Wick rotation
$$p^0_M~=~ie^{-i\epsilon}p^0_E .\tag{J}$$
as compared to eq. (A), cf. Refs. 2 & 3.
References:

*

*J. Cardy, Intro to QFT, 2010; p. 17.


*M. Srednicki, QFT, 2007; p. 55 + p. 99. A prepublication draft PDF file is available here.


*S. Weinberg, Quantum Theory of Fields, Vol. 1, 1995; Section 11.2 p. 476.
--
$^1$ Conventions & notations: In this answer we use the $(-,+,+,+)$ Minkowski signature convention and the speed of light is $c=1$. The subscripts $E$ and $M$ means Euclidean and Minkowskian, respectively.
