Let $V \subset L^2(\mathbb{R})$ be the space of functions supported on $E$, and $W$ the space of functions whose Fourier transform is supported on $F$. (This notation differs from Jason's hint, sorry.) Note both subspaces are closed. Use the A-B theorem to show that $V \cap W = 0$, which is easy, and that $V+W$ is closed, which is a little harder. One approach to the latter is this: any function in $V+W$ can be written uniquely as $f+g$ where $f \in V$, $g \in W$. Then $V+W$ is closed iff the operators $f+g \mapsto f$ and $f+g \mapsto g$ are bounded, for then the map $f+g \mapsto (f,g)$ is an isomorphism of $V+W$ with $V \oplus W$.

To show the latter, we can use the A-B theorem to write, for $f \in V$, $g \in W$,
$$\require{cancel}\begin{align*}
\|f\|_{L^2(\mathbb{R})} &\le C(\cancel{\|f\|_{L^2(E^c)}} + \|\mathcal{F}(f)\|_{L^2(F^c)}) \\
&= C \|\mathcal{F}(f+g)\|_{L^2(F^c)} && \text{since $\mathcal{F}g = 0$ on $F^c$} \\
&\le C \|\mathcal{F}(f+g)\|_{L^2(\mathbb{R})} \\
&= C\|f+g\|_{L^2(\mathbb{R})} && \text{Plancherel}.
\end{align*}$$

So the map $f+g \mapsto f$ is bounded, and a similar argument works for $f+g \mapsto g$.

Now that $V+W$ is closed, consider the orthogonal projections $P_V h = 1_E \cdot h$ and $P_W h = \mathcal{F}^{-1} (1_F \cdot \mathcal{F}h)$. By the below lemma, taking $f = g_1 \in V$ and $g=\mathcal{F}^{-1} g_2$, we can find $h$ such that $P_V h = f$, which is to say $h=g_1$ on $E$, and $P_W h = g$, which is to say $\mathcal{F}h = g_2$ on $F$.

**Lemma.** Suppose $V,W$ are two closed subspaces of a Hilbert space $H$ with $V \cap W = 0$ and $V+W$ closed. Then for every $f \in V$, $g \in W$, there exists a unique $h \in V+W$ with $P_V h = f$ and $P_W h = g$.

I don't have a reference for this, so here's a proof based on ideas from [1].

The idea is that if we want to have $(P_V + P_W)h = f+g$, where $h=v+w$ with $v \in V$, $w \in W$, then we must have
$$\begin{align*} v + P_V w &= f \\ w + P_W v &= g. \end{align*}$$
Applying $P_V$ to the second equation and subtracting, we need to have $v - P_V P_W v = f - P_V g$. We show that we can find such $v$, and that it works.

Let $P_W|_V$ be the restriction of $P_W$ to $V$. Then I claim $\|P_W|_V\| < 1$. To see this, first recall that $v+w \mapsto v$ is bounded, so there is a constant $K$ so that $\|v\| \le K \|v+w\|$ for all $v \in V$, $w \in W$. Now let $v \in V$ be arbitrary. Since $P_W v$ and $v - P_W v$ are orthogonal, the Pythagorean theorem gives
$$\|v\|^2 = \|P_W v\|^2 + \|v-P_W v\|^2 \ge \|P_W v\|^2 + \frac{1}{K^2} \|v\|^2$$
and thus $\|P_W v\|^2 \le (1-\frac{1}{K^2}) \|v\|^2$.

As such, the operator $I - P_V P_W$, considered as an operator on $V$, is invertible. Let $v = (I-P_V P_W)^{-1}(f - P_V g)$, so that $v - P_V P_W v = f - P_V g$. Then set $w = g - P_W v$, and $h = v+w$. We now have
$$\begin{align*}
P_V h &= v + P_V g - P_V P_W v = f - P_V g + P_V g = f \\
P_W h &= P_W v + g - P_W v = g
\end{align*}$$
as desired.

[1] *Deutsch, Frank*, The angle between subspaces of a Hilbert space, Singh, S. P. (ed.) et al., Approximation theory, wavelets and applications. Proceedings of the NATO Advanced Study Institute on recent developments in approximation theory, wavelets and applications, Maratea, Italy, May 16-26, 1994. Dordrecht: Kluwer Academic Publishers. NATO ASI Ser., Ser. C, Math. Phys. Sci. 454, 107-130 (1995). ZBL0848.46010, https://doi.org/10.1007/978-94-015-8577-4_7