Let $X$ be a smooth, projective variety and $Z_1, Z_2$ two smooth, projective subvarieties in $X$ of the same dimension. Let $E$ be a locally free sheaf on $X$. Recall, there are natural morphims:

$$g_i:H^k_{Z_i}(E) \xrightarrow{f_i} H^k_{Z_1 \cup Z_2}(E) \to H^k(E)$$

for $i=1,2$. Let $\alpha_i \in H^k_{Z_i}(E)$ for $i=1,2$. Is it true that $g_1(\alpha_1)=g_2(\alpha_2)$ if and only if $f_1(\alpha_1)=f_2(\alpha_2)$? (If necessary assume that $Z_1 \cap Z_2$ is of codimension at least $2$ in both $Z_1$ and $Z_2$).

Any idea/reference will be most welcome.