First, assume the lemma holds in case $X$ is quasi-compact (we will do the quasi-compact case below). As $X$ is locally of finite type over a field, it is locally Noetherian, see Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian}. In particular this means that it is locally connected, connected components of open subsets are open, and intersections of quasi-compact opens are quasi-compact, see Properties, Lemma \ref{properties-lemma-Noetherian-topology}, Topology, Lemma \ref{topology-lemma-locally-connected}, Topology, Section \ref{topology-section-noetherian}, and Topology, Lemma \ref{topology-lemma-constructible-Noetherian-space}. Pick an open covering $X = \bigcup_{i \in I} U_i$ such that each $U_i$ is quasi-compact and connected. For each $i$ let $K_i \subset \mathcal{O}_X(U_i)$ be the integral closure of $k_1$ and of $k_2$. For each pair $i, j \in I$ we decompose $$ U_i \cap U_j = \coprod U_{i, j, l} $$ into its finitely many connected components. Write $K_{i, j, l} \subset \mathcal{O}(U_{i, j, l})$ for the integral closure of $k_1$ and of $k_2$. By Lemma \ref{lemma-integral-closure-ground-field} the rings $K_i$ and $K_{i, j, l}$ are fields. Now we claim that $k_1'$ and $k_2'$ both equal the kernel of the map $$ \prod K_i \longrightarrow \prod K_{i, j, l}, \quad (x_i)_i \longmapsto x_i|_{U_{i, j, l}} - x_j|_{U_{i, j, l}} $$ which proves what we want. Namely, it is clear that $k_1'$ is contained in this kernel. On the other hand, suppose that $(x_i)_i$ is in the kernel. By the sheaf condition $(x_i)_i$ corresponds to $f \in \mathcal{O}(X)$. Pick some $i_0 \in I$ and let $P(T) \in k_1[T]$ be a monic polynomial with $P(x_{i_0}) = 0$. Then we claim that $P(f) = 0$ which proves that $f \in k_1$. To prove this we have to show that $P(x_i) = 0$ for all $i$. Pick $i \in I$. As $X$ is connected there exists a sequence $i_0, i_1, \ldots, i_n = i \in I$ such that $U_{i_t} \cap U_{i_{t + 1}} \not = \emptyset$. Now this means that for each $t$ there exists an $l_t$ such that $x_{i_t}$ and $x_{i_{t + 1}}$ map to the same element of the field $K_{i, j, l}$. Hence if $P(x_{i_t}) = 0$, then $P(x_{i_{t + 1}}) = 0$. By induction, starting with $P(x_{i_0}) = 0$ we deduce that $P(x_i) = 0$ as desired. \medskip\noindent To finish the proof of the lemma we prove the lemma under the additional hypothesis that $X$ is quasi-compact. By Lemma \ref{lemma-integral-closure-ground-field} after replacing $k_i$ by $k_i'$ we may assume that $k_i$ is integrally closed in $\Gamma(X, \mathcal{O}_X)$. This implies that $\mathcal{O}(X)^*/k_i^*$ is a finitely generated abelian group, see Proposition \ref{proposition-units-general}. Let $k_{12} = k_1 \cap k_2$ as a subring of $\mathcal{O}(X)$. Note that $k_{12}$ is a field. Since $$ k_1^*/k_{12}^* \longrightarrow \mathcal{O}(X)^*/k_2^* $$ we see that $k_1^*/k_{12}^*$ is a finitely generated abelian group as well. Hence there exist $\alpha_1, \ldots, \alpha_n \in k_1^*$ such that every element $\lambda \in k_1$ has the form $$ \lambda = c \alpha_1^{e_1} \ldots \alpha_n^{e_n} $$ for some $e_i \in \mathbf{Z}$ and $c \in k_{12}$. In particular, the ring map $$ k_{12}[x_1, \ldots, x_n, \frac{1}{x_1 \ldots x_n}] \longrightarrow k_1, \quad x_i \longmapsto \alpha_i $$ is surjective. By the Hilbert Nullstellensatz, Algebra, Theorem \ref{algebra-theorem-nullstellensatz} we conclude that $k_1$ is a finite extension of $k_{12}$. In the same way we conclude that $k_2$ is a finite extension of $k_{12}$. In particular both $k_1$ and $k_2$ are contained in the integral closure $k_{12}'$ of $k_{12}$ in $\Gamma(X, \mathcal{O}_X)$. But since $k_{12}'$ is a field by Lemma \ref{lemma-integral-closure-ground-field} and since we chose $k_i$ to be integrally closed in $\Gamma(X, \mathcal{O}_X)$ we conclude that $k_1 = k_{12} = k_2$ as desired.