Residues and Gysin long exact for open varieties I am familiar with the following: 
let $X$ be a smooth projective complex variety, $D$ a smooth divisor in $X$ and $U=X \setminus Z$. Then there is on the one hand a residue map 
$$
\mathrm{Res}_D \colon H^n_{dR}(U) \longrightarrow H^{n-1}_{dR}(D)
$$ induced from the exact sequence of sheaves $0 \to \Omega^p_X \to \Omega^p_X(\log D) \to \Omega^{p-1}_D \to 0,$ and on the other hand the tubular map in homology 
$$
T \colon H_{n-1}(D) \to H_n(U).  
$$ They are related by 
$$
\int_\sigma \mathrm{Res}_D(\omega)=\frac{1}{2\pi i} \int_{T(\sigma)} \omega 
$$ for all $\sigma \in H_{n-1}(D)$ and $\omega \in H^n_{dR}(U)$. 
Question: I guess this is still true when $X$ is not supposed projective, because everything seems very local. Do you know a good reference? 
 A: The Gysin sequence in the form you need is a purely topological based on the long exact cohomological sequence of a pair, the Thom isomophism and Poincare duality.   
The Gysin sequence is obtained from the long exact sequence  of the pair $(T(D), \partial T(D))$ where $T(D)$ is a tubular neighborhood of $D$ in $X$. Note  that we have a natural projection $\pi: T(D)\to D$. Moreover,  by excision
$$ H^\bullet(T(D),\partial T(D)\;)\cong H^\bullet (X, X\setminus D). $$
$\newcommand{\pa}{\partial}$
If $D$ is compact  then it carries a homology class $[D]$ and its Poincare dual is the Thom class  $\tau\in H^2(T(D),\partial T(D))$.   
The Thom isomorphism theorem states that the map $\Psi: H^\bullet (T(D)D)\to H^{\bullet +2}(T(D),\pa T(D))$  given by 
$$
H^kT(D)\cong H^k(D)\ni \alpha \mapsto \tau \cup \pi^*\alpha\in H^{k+2}(T(D),\pa T(D))
$$
is an isomorphism.
The long exact sequence
$$
\cdots \to H^k(T(D),\pa T(D))\to H^k(T(D))\to H^k (\pa T(D))\to  H^{k+1}(T(D),\pa T(D))\to\cdots
$$
can be rewritten using the Thom isomorphism in the form
$$
\cdots \to H^{k-2}(T(D))\to H^k(T(D))\to H^k (\pa T(D))\to  H^{k-1}(T(D))\to\cdots
$$
Note that $H^\bullet(T(D))\cong H^\bullet (D)$ so we obtain
$$
\cdots \to H^{k-2}(D)\to H^k(D)\to H^k (\pa T(D))\to  H^{k-1}(D)\to\cdots
$$
We set $N:=\dim_{\mathbb{C}} X$ and $m:=2N-k$. 
Using the  Poincare dualities
$$
H^j(D)\cong H_{2N-2-j}(D),\;\; H^j(\pa T(D))\cong H_{2N-1-j}( \pa T(D))
$$
we obtain a long exact sequence
$$\cdots \to H_m(D)\to  H_{m-2}( D) \stackrel{T}{\to} H_{m-1}(\pa T(D))\to  H_{m-1}(D)\to\cdots .$$
Above, $T$ is the so called tube morphism.  Its Kronecker dual is the Residue morphism. See these notes for more details.
If $D$ is non-compact, then you will have to use Borel-Moore homology  $H_\bullet^{BM}$ instead of the usual homology,
$$ H_\bullet^{BM}(X,\mathbb{C})={\rm Hom}\;(\; H^\bullet_{cpt}(X,\mathbb{C}),\mathbb{C}\;). $$
