Write $Y = \Spec(A)$ and $Y' = \Spec(A')$. As a base change of an affine morphism, the morphism $g'$ is affine. Let $M$ be a perfect generator for $D_\QCoh(\mathcal{O}_X)$, see Derived Categories of Spaces, Theorem \ref{spaces-perfect-theorem-bondal-van-den-Bergh}. Then $L(g')^*M$ is a generator for $D_\QCoh(\mathcal{O}_{X'})$, see Derived Categories of Spaces, Remark \ref{spaces-perfect-remark-pullback-generator}. Hence it suffices to show that (\ref{equation-base-change-map}) induces an isomorphism \begin{equation} \label{equation-iso} R\Hom_{X'}(L(g')^*M, L(g')^*a(K)) \longrightarrow R\Hom_{X'}(L(g')^*M, a'(Lg^*K)) \end{equation} of global hom complexes, see Cohomology on Sites, Section \ref{sites-cohomology-section-global-RHom}, as this will imply the cone of $L(g')^*a(K) \to a'(Lg^*K)$ is zero. The structure of the proof is as follows: we will first show that these Hom complexes are isomorphic and in the last part of the proof we will show that the isomorphism is induced by (\ref{equation-iso}). \medskip\noindent The left hand side. Because $M$ is perfect, the canonical map $$ R\Hom_X(M, a(K)) \otimes^\mathbf{L}_A A' \longrightarrow R\Hom_{X'}(L(g')^*M, L(g')^*a(K)) $$ is an isomorphism by Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-affine-morphism-and-hom-out-of-perfect}. We can combine this with the isomorphism $R\Hom_Y(Rf_*M, K) = R\Hom_X(M, a(K))$ of Lemma \ref{lemma-iso-global-hom} to get that the left hand side equals $R\Hom_Y(Rf_*M, K) \otimes^\mathbf{L}_A A'$. \medskip\noindent The right hand side. Here we first use the isomorphism $$ R\Hom_{X'}(L(g')^*M, a'(Lg^*K)) = R\Hom_{Y'}(Rf'_*L(g')^*M, Lg^*K) $$ of Lemma \ref{lemma-iso-global-hom}. Since $f$ and $g$ are Tor independent the base change map $Lg^*Rf_*M \to Rf'_*L(g')^*M$ is an isomorphism by Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-compare-base-change}. Hence we may rewrite this as $R\Hom_{Y'}(Lg^*Rf_*M, Lg^*K)$. Since $Y$, $Y'$ are affine and $K$, $Rf_*M$ are in $D_\QCoh(\mathcal{O}_Y)$ (Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-quasi-coherence-direct-image}) we have a canonical map $$ \beta : R\Hom_Y(Rf_*M, K) \otimes^\mathbf{L}_A A' \longrightarrow R\Hom_{Y'}(Lg^*Rf_*M, Lg^*K) $$ in $D(A')$. This is the arrow More on Algebra, Equation (\ref{more-algebra-equation-base-change-RHom}) where we have used Derived Categories of Schemes, Lemmas \ref{perfect-lemma-affine-compare-bounded} and \ref{perfect-lemma-quasi-coherence-internal-hom} to translate back and forth into algebra. \begin{enumerate} \item If $f$ is flat and of finite presentation, the complex $Rf_*M$ is perfect on $Y$ by Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-flat-proper-perfect-direct-image-general} and $\beta$ is an isomorphism by More on Algebra, Lemma \ref{more-algebra-lemma-base-change-RHom} part (1). \item If $f$ is perfect and $Y$ Noetherian, the complex $Rf_*M$ is perfect on $Y$ by More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-perfect-proper-perfect-direct-image} and $\beta$ is an isomorphism as before. \item If $g$ has finite tor dimension and $Y$ is Noetherian, the complex $Rf_*M$ is pseudo-coherent on $Y$ (Derived Categories of Spaces, Lemmas \ref{spaces-perfect-lemma-direct-image-coherent} and \ref{spaces-perfect-lemma-identify-pseudo-coherent-noetherian}) and $\beta$ is an isomorphism by More on Algebra, Lemma \ref{more-algebra-lemma-base-change-RHom} part (4). \end{enumerate} We conclude that we obtain the same answer as in the previous paragraph. \medskip\noindent In the rest of the proof we show that the identifications of the left and right hand side of (\ref{equation-iso}) given in the second and third paragraph are in fact given by (\ref{equation-iso}). To make our formulas manageable we will use $(-, -)_X = R\Hom_X(-, -)$, use $- \otimes A'$ in stead of $- \otimes_A^\mathbf{L} A'$, and we will abbreviate $g^* = Lg^*$ and $f_* = Rf_*$. Consider the following commutative diagram $$ \xymatrix{ ((g')^*M, (g')^*a(K))_{X'} \ar[d] & (M, a(K))_X \otimes A' \ar[l]^-\alpha \ar[d] & (f_*M, K)_Y \otimes A' \ar@{=}[l] \ar[d] \\ ((g')^*M, (g')^*a(g_*g^*K))_{X'} & (M, a(g_*g^*K))_X \otimes A' \ar[l]^-\alpha & (f_*M, g_*g^*K)_Y \otimes A' \ar@{=}[l] \ar@/_4pc/[dd]_{\mu'} \\ ((g')^*M, (g')^*g'_*a'(g^*K))_{X'} \ar[u] \ar[d] & (M, g'_*a'(g^*K))_X \otimes A' \ar[u] \ar[l]^-\alpha \ar[ld]^\mu & (f_*M, K) \otimes A' \ar[d]^\beta \\ ((g')^*M, a'(g^*K))_{X'} & (f'_*(g')^*M, g^*K)_{Y'} \ar@{=}[l] \ar[r] & (g^*f_*M, g^*K)_{Y'} } $$ The arrows labeled $\alpha$ are the maps from Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-affine-morphism-and-hom-out-of-perfect} for the diagram with corners $X', X, Y', Y$. The upper part of the diagram is commutative as the horizontal arrows are functorial in the entries. The middle vertical arrows come from the invertible transformation $g'_* \circ a' \to a \circ g_*$  of Lemma \ref{lemma-flat-precompose-pus} and therefore the middle square is commutative. Going down the left hand side is (\ref{equation-iso}). The upper horizontal arrows provide the identifications used in the second paragraph of the proof. The lower horizontal arrows including $\beta$ provide the identifications used in the third paragraph of the proof. Given $E \in D(A)$, $E' \in D(A')$, and $c : E \to E'$ in $D(A)$ we will denote $\mu_c : E \otimes A' \to E'$ the map induced by $c$ and the adjointness of restriction and base change; if $c$ is clear we write $\mu = \mu_c$, i.e., we drop $c$ from the notation. The map $\mu$ in the diagram is of this form with $c$ given by the identification $(M, g'_*a(g^*K))_X = ((g')^*M, a'(g^*K))_{X'}$ ; the triangle involving $\mu$ is commutative by Derived Categories of Spaces, Remark \ref{spaces-perfect-remark-multiplication-map}. \medskip\noindent Observe that $$ \xymatrix{ (M, a(g_*g^*K))_X & (f_*M, g_* g^*K)_Y \ar@{=}[l] & (g^*f_*M, g^*K)_{Y'} \ar@{=}[l] \\ (M, g'_* a'(g^*K))_X \ar[u] & ((g')^*M, a'(g^*K))_{X'} \ar@{=}[l] & (f'_*(g')^*M, g^*K)_{Y'} \ar@{=}[l] \ar[u] } $$ is commutative by the very definition of the transformation $g'_* \circ a' \to a \circ g_*$. Letting $\mu'$ be as above corresponding to the identification $(f_*M, g_*g^*K)_X = (g^*f_*M, g^*K)_{Y'}$, then the hexagon commutes as well. Thus it suffices to show that $\beta$ is equal to the composition of $(f_*M, K)_Y \otimes A' \to (f_*M, g_*g^*K)_X \otimes A'$ and $\mu'$. To do this, it suffices to prove the two induced maps $(f_*M, K)_Y \to (g^*f_*M, g^*K)_{Y'}$ are the same. In other words, it suffices to show the diagram $$ \xymatrix{ R\Hom_A(E, K) \ar[rr]_{\text{induced by }\beta} \ar[rd] & & R\Hom_{A'}(E \otimes_A^\mathbf{L} A', K \otimes_A^\mathbf{L} A') \\ & R\Hom_A(E, K \otimes_A^\mathbf{L} A') \ar[ru] } $$ commutes for all $E, K \in D(A)$. Since this is how $\beta$ is constructed in More on Algebra, Section \ref{more-algebra-section-base-change-RHom} the proof is complete.