In the Quantum Field Theory An Integrated Approach, Fradkin, the author derived the partition functional for a free scalar field (after analytic continuation to imaginary time ) as $$Z_{E}[J]=Z_{E}[0] e^{\frac{1}{2} \int d^{D} x \int d^{D} x^{\prime} J(x) G_{0}^{E}\left(x-x^{\prime}\right) J\left(x^{\prime}\right)}\tag{5.141}$$ where $$Z_{E}[0]=\int \mathcal{D} \xi e^{-\frac{1}{2} \int d^{D} x \xi(x)\left[-\partial^{2}+m^{2}\right] \xi(x)}.\tag{5.142}$$ ($Z_{E}[0]$ is not important for the present case.) It was argued that, the Wick's theorem is equivalent to $$\begin{aligned} \left\langle\phi\left(x_{1}\right) \cdots \phi\left(x_{N}\right)\right\rangle &=\left.\frac{1}{Z_{E}[0]} \frac{\delta^{N} Z_{E} \left[J\right]}{\delta J\left(x_{1}\right) \cdots \delta J\left(x_{N}\right)}\right|_{J=0} \\ &=\left\langle\phi\left(x_{1}\right) \phi\left(x_{2}\right)\right\rangle \cdots\left\langle\phi\left(x_{N-1}\right) \phi\left(x_{N}\right)\right\rangle\\ &+\text { permutations. } \end{aligned}\tag{5.155}$$ I was not able to derive this expression, nor able to show the total number of terms in this equation is $$(2 k-1)(2 k-3) \cdots=\frac{(2 k) !}{2^{k} k !}\tag{5.156}$$
I am aware of a few alternative proofs to Wick's theorem, but I would like to know how to show this result using this partition function approach. Specifically, how am I supposed to get all these permutation terms, and how should I count the total number of terms in the equation?