Since$$p(\theta_1,\ldots,\theta_{k-1})\propto (1-\theta_1-\cdots-\theta_{k-1})^{\alpha_{k}-1}\prod_{i=1}^{k-1} \theta_i^{\alpha_i-1}$$over the $\mathbb R^k$-simplex,
$$\mathfrak S = \left\{(\theta_1,\ldots,\theta_{k-1})\in\mathbb R^{k-1}_+\,;\,\sum_{i=1}^{k-1} \theta_i\le 1\right\}$$
integrating out $\theta_{k-1}$ produces the marginal density of $(\theta_1,\ldots,\theta_{k-2})$:
\begin{align}
p(\theta_1,\ldots,\theta_{k-2})&\propto \int_0^{1-\theta_1-\cdots-\theta_{k-2}}
(1-\theta_1-\cdots-\theta_{k-1})^{\alpha_k-1}\prod_{i=1}^{k-1} \theta_i^{\alpha_i-1}\,\text d\theta_{k-1}\\
&= \prod_{i=1}^{k-2} \theta_i^{\alpha_i-1}\, \int_0^{1-\theta_1-\cdots-\theta_{k-2}}
(1-\theta_1-\cdots-\theta_{k-1})^{\alpha_{k}-1}\,\theta_{k-1}^{\alpha_{k-1}-1}\,\text d\theta_{k-1}\\
\end{align}
Given the upper bound on $\theta_{k-1}$ found in the integral, one can rather naturally consider the change of variable
$$\theta_{k-1}=(1-\theta_1-\cdots-\theta_{k-2})\eta$$
leading to
\begin{align}
p(\theta_1,\ldots,\theta_{k-2})
&= \prod_{i=1}^{k-2} \theta_i^{\alpha_i-1}\, \int_0^1
(1-\theta_1-\cdots-\theta_{k-2})^{\alpha_{k-1}-1}(1-\eta)^{\alpha_{k-1}-1}\\
&\qquad\times(1-\theta_1-\cdots-\theta_{k-2})^{\alpha_{k-1}-1}\eta^{\alpha_{k-1}-1}\, (1-\theta_1-\cdots-\theta_{k-2})\text d\eta\\
&=\prod_{i=1}^{k-2} \theta_i^{\alpha_i-1}\,(1-\theta_1-\cdots-\theta_{k-2})^{\alpha_{k-1}+\alpha_k-1}\,
\underbrace{\int_0^1 (1-\eta)^{\alpha_{k}-1}\eta^{\alpha_{k-1}-1}\,\text d\eta}_\text{constant in $\theta$}\\
&\propto\prod_{i=1}^{k-2} \theta_i^{\alpha_i-1}\,(1-\theta_1-\cdots-\theta_{k-2})^{\alpha_{k-1}+\alpha_k-1}\,
\end{align}