How can I compute the cohomology of a complement? Given a compact "nice" topological space $X$ and a closed subspace $Z$, is there any way to relate the cohomology of $U=X-Z$ with $X$ and $Z$? I know there is the long exact sequence of the pair $(X,Z)$, but I'm not sure if
$$
H^*(X,Z) \cong H^*(U)
$$
 A: This is not true. For example, consider just homology of $D^2$  and its boundary $S^1$. $H_1(D^2,S_1)=\mathbb Z$ while $D^n-S^1$ is contractible.
On the other hand, there is a result known as Alexander Duality for manifolds:
$$\tilde{H}^k(M) \cong \tilde{H}_{n-k-1}(S^n-M),$$
where these are reduced (co)homology, but this is a very partial result, I don't know of anything stronger.
I found this for complements of $1$ manifolds (compact) in $3$ manifolds as well.
A: A partial answer.  Suppose $V\subset Z\subset X$ with the closure of $V$ in the interior of $Z$.  Excision gives $H^n(X,Z)\cong H^n(X-V,Z-V)$.  Suppose $Z,V$ are nice enough so that $H^n(X-V)\to H^n(X-Z)$ is an isomorphism.  With the long exact sequence of the pair $(X-V,Z-V)$, if we did have an isomorphism $H^n(X,Z)\cong H^n(X-Z)$, we would need $H^*(Z-V)\cong 0$, which is roughly that the "boundary" of $Z$ is homologically trivial.
In Andres's example of $(D^2,S^1)$, the $Z=S^1$ is not homologically trivial.
Another example is $(S^2,x_0)$, where $S^2-x_0$ is nullhomotopic, but $H^*(S^2,x_0)$ is reduced cohomology of $S^2$.  (The point has  a "boundary" which is an $S^1$.)
