https://en.wikipedia.org/wiki/Beta_distribution#Derived_from_other_distributions
https://en.wikipedia.org/wiki/Gamma_distribution#Related_distributions
First of all, a well known, preliminary result used here is that if $X \sim \text{Gamma}(k_1, \theta), Y \sim \text{Gamma}(k_2, \theta)$ and they are independent, then
$$ \frac {X} {X+Y} \sim \text{Beta}(k_1, k_2)$$
Note that this result require both $X, Y$ have the same scale parameters, which you do not have yet. And as $\theta_1, \theta_2$ are the scale parameters, we have
$$ \frac {X} {\theta_1} \sim \text{Gamma}(k_1, 1), \frac {Y} {\theta_2} \sim \text{Gamma}(k_2, 1)$$
Therefore,
$$ \begin{align} \Pr\{X > Y\} &= \Pr\left\{\frac {X} {\theta_1} > \left(\frac {1} {\theta_1} + \frac {1} {\theta_2}\right) Y - \frac {Y} {\theta_2}\right\} \\
&= \Pr\left\{ \frac {Y} {\displaystyle \frac {Y} {\theta_2} + \frac {X} {\theta_1}} < \frac {\theta_1\theta_2} {\theta_1 + \theta_2} \right\} \\
&= \Pr\left\{ \frac {\displaystyle \frac {Y} {\theta_2}} {\displaystyle \frac {X} {\theta_1} + \frac {Y} {\theta_2} } < \frac {\theta_1} {\theta_1 + \theta_2} \right\} \\
&= F_Z\left(\frac {\theta_1} {\theta_1 + \theta_2} \right)
\end{align}$$
where
$$ Z = \frac {\displaystyle \frac {Y} {\theta_2}} {\displaystyle \frac {X} {\theta_1} + \frac {Y} {\theta_2} } \sim \text{Beta}(k_2, k_1)$$
and $F_Z$ is the CDF of $Z$. Finally you just need to use the result from Beta CDF:
https://en.wikipedia.org/wiki/Beta_distribution#Cumulative_distribution_function