Given the Euclidean action \begin{equation} S_E(\phi) = \int d^d x \frac{1}{2}\big(\nabla\phi\cdot\nabla\phi + m^2\phi^2\big)\end{equation} and the partition function \begin{equation}\mathcal{Z} = \int \mathcal{D}\phi(x)e^{-S_E(\phi) + \int d^d x J(x)\phi(x)} \end{equation} I need to show that the $n$-point correlator $\left\langle\phi(x_1)\phi(x_2)...\phi(x_n)\right\rangle$ satisfies $$\left\langle\phi(x_1)\phi(x_2)...\phi(x_n)\right\rangle = \sum_{i = 2}^nG(x_1 - x_i)\left\langle\phi(x_2)...\phi(x_{i-1})\phi(x_{i+1})...\phi(x_n)\right\rangle$$ where $G(x_1 - x_i) = \left\langle\phi(x_1)\phi(x_i)\right\rangle$.
I tried getting there by using that \begin{equation} \left\langle\phi(x_1)\phi(x_2)...\phi(x_n)\right\rangle = {\frac{1}{\mathcal{Z}}\frac{\delta}{\delta J(x_1)}...\frac{\delta}{\delta J(x_n)}\mathcal{Z}}_{J = 0} \end{equation} by calculating the derivatives directly and I also tried doing it by induction, but both if these methods did not get me anywhere.
I also thought about proving that this statement is equivalent to Wick's theorem, but I'm not sure why.
Could someone help me out with this please?