It is possible to derive this integral using the expression for the normalization constant of the dirichlet distribution. The key idea is to recast the integral containing the terms not involving $x_j$ by performing a change of variables into an integral which is similar to the one used to derive the normalization constant of the dirichlet distribution.
I will perform an equivalent integration process by using the following density function.
$$p(\mathbf{x}) = \frac{\Gamma(a_0)}{\prod_{i=1}^{K}\Gamma(a_i)} \prod_{j=1}^{K} x_j^{a_j-1} \\ where \quad a_0 = \sum_{i=1}^{K}a_i \\ and \quad \sum_{i=1}^{K}x_i = 1 \\ Also, \quad x_K = 1 - \sum_{i=1}^{K-1}x_i$$
I aim to find the marginal distribution of $p(x_j)$.Now, in order to incorporate the constraint $\sum_{i=1}^{K}x_i = 1$, I make the observation that $\sum_{i=1}^{j-1}x_i + \sum_{l=j+1}^{K}x_l = 1 - x_j$ and derive the limits of integration as shown in the following equation. Additionally, integration is not performed over the variable $x_K$ which is set equal to $1 - \sum_{i=1}^{K-1}x_i$.
$$p(x_j) = x_j^{a_j-1}\int_{0}^{1-\sum_{p=1}^{K-2}x_p}\int_{0}^{1-\sum_{p=1}^{K-3}x_p}\ldots \int_{0}^{1-\sum_{p=1}^{j+1-1}x_p} \int_{0}^{1-x_j-\sum_{p=1}^{j-2}x_p} \ldots \int_{0}^{1-x_j-x_1} \int_{0}^{1-x_j}\frac{\Gamma(a_0)}{\prod_{i=1}^{K}\Gamma(a_i)} \prod_{q=1,\\ q\neq j}^{K} x_q^{a_q-1} dx_1 dx_2 \ldots dx_{j-1} dx_{j+1}\ldots dx_{K-2} dx_{K-1}$$
Now I perform a change of variables to arrive at an integral which is similar to the one used to calculate the normalization constant of the dirichlet distribution. More specifically, I use the new variables as shown below to perform this change of variables.
$$x_1' = \frac{x_1}{1-x_j}, ~~ x_2' = \frac{x_2}{1-x_j},~~\ldots~~,x_{j-1}' = \frac{x_{j-1}}{1-x_j},~~\ldots~~,x_K' = \frac{x_K}{1-x_j}$$
The limits of integration for the variable $x_1$ now get modified from $x_1 = \{0, x_j-1\}$ to $x_1' = \{0, 1\}$. For the variable $x_2$, these get transformed from $x_2 = \{0, 1-x_j-x_1\}$ to $x_2' = \{0, 1-x_1'\}$. A similar transformation occurs for the other variables. The resulting variable transformation results in a factor of $(1-x_j)^{K-2}$ as a result of the Jacobian term. This arises due to the presence of $K-2$ differential terms $(dx_i)$ in the integral and the observation that $dx_l=(1 - x_j)dx_l'$. The final integral can be simplified in the following manner.
$$p(x_j) = x_j^{a_j-1} (1-x_j)^{K-2}\int_{0}^{1-\sum_{p=1,p \neq j}^{K-2}x_p'}\int_{0}^{1-\sum_{p=1,p \neq j}^{K-3}x_p'}\ldots \int_{0}^{1-\sum_{p=1,p \neq j}^{j+1-1}x_p'} \int_{0}^{1-\sum_{p=1}^{j-2}x_p'} \ldots \int_{0}^{1-x_1'} \int_{0}^{1}\frac{\Gamma(a_0)}{\prod_{i=1}^{K}\Gamma(a_i)} \prod_{q=1,\\ q\neq j}^{K} {x_q'}^{a_q-1} (1-x_j)^{a_q-1} dx_1' dx_2' \ldots dx_{j-1}' dx_{j+1}'\ldots dx_{K-2}' dx_{K-1}'$$
It can be observed that $\prod_{q=1,\\ q\neq j}^{K}(1-x_j)^{a_q-1} = (1-x_j)^{\sum_{q=1,\\ q\neq j}^{K}a_q-1}=(1-x_j)^{a_0-a_j-(K-1)}$. This term can be taken outside the integration and multiplied with $(1-x_j)^{K-2}$ to yield $(1-x_j)^{a_0-a_j-1}$. The simplified integral is shown as follows.
$$p(x_j) = \frac{\Gamma(a_0)}{\prod_{i=1}^{K}\Gamma(a_i)} x_j^{a_j-1} (1-x_j)^{a_0-a_j-1}\int_{0}^{1-\sum_{p=1,p \neq j}^{K-2}x_p'}\int_{0}^{1-\sum_{p=1,p \neq j}^{K-3}x_p'}\ldots \int_{0}^{1-\sum_{p=1,p \neq j}^{j+1-1}x_p'} \int_{0}^{1-\sum_{p=1}^{j-2}x_p'} \ldots \int_{0}^{1-x_1'} \int_{0}^{1} \prod_{q=1,\\ q\neq j}^{K} {x_q'}^{a_q-1} dx_1' dx_2' \ldots dx_{j-1}' dx_{j+1}'\ldots dx_{K-2}' dx_{K-1}'$$
It can be observed that $\sum_{i=1,i \neq j}^{K}x_i' = \frac{\sum_{i=1,i\neq j}^{K} x_i}{1-x_j} = \frac{1-x_j}{1-x_j} = 1$. Hence, the resulting integral with the new variables is the same as the integral used for calculating the normalization constant of the dirichlet distribution except that the $x_j^{a_j-1}$ term is absent. Hence, the integral simplifies to $\frac{\prod_{i=1,i \neq j}^{K}\Gamma(a_i)}{\Gamma(a_0 - a_j)}$. After cancellation with the original gamma function terms present outside the integral, we obtain the final result shown below.
$$p(x_j) = \frac{\Gamma(a_0)}{\Gamma(a_j)\Gamma(a_0 - a_j)} x_j^{a_j-1} (1-x_j)^{a_0-a_j-1} \\ p(x_j) = \frac{1}{B(a_j, a_0-a_j)} x_j^{a_j-1} (1-x_j)^{a_0-a_j-1} \\ p(x_j) = Beta(x_j;a_j, a_0-a_j)$$