No. Take a prime $p$, a non-abelian group $G$ of order $p^3$, and $N$ a subgroup of $G$ of order $p^2$. We have that $G'$ has order $p$, and $G'\le N$.
Then $C_{G}(N) = N$, while $C_{G}(N \cap G') = C_{G}(G') = G$.
I believe the comment by James is correct, these groups are precisely the $2$-Engel groups.
Claim: The following statements are equivalent for a group $G$.
Every centralizer in $G$ is a normal subgroup.
Any two conjugate elements in $G$ commute, ie. $x^g x = x x^g$ for all $x, g \in G$.
$G$ is a $2$-Engel group, ie. $[[x,g],g] = 1$ for all $x, g \in G$.
Proof:
1) implies 2): $x \in C_G(x)$, thus $x^g \in C_G(x)$ since $C_G(x)$ is normal.
2) implies 3): $x^g = x[x,g]$ commutes with $x$, thus $[x,g]$ also commutes with $x$.
3) implies 1): If $[[x,g],g] = 1$ for all $g \in G$, then according to Lemma 2.2 in [*], we have $[x, [g,h]] = [[x,g],h]^2$. Therefore $[C_G(x), G] \leq C_G(x)$, which means that $C_G(x)$ is a normal subgroup.
[*] Wolfgang Kappe, Die $A$-Norm einer Gruppe, Illinois J. Math. Volume 5, Issue 2 (1961), 187-197. link
Best Answer
I do not think there is a general condition. What you can say is this.
(a) $Z(G)=C_G(H)$ if and only if $Z(H)=H \cap Z(G)$.
(b) Note that $Z(G)=\bigcap_{g \in G}C_G(g)$. And $g \notin Z(G)$ if and only if $Z(G) \subsetneq C_G(g) \subsetneq G$. Otherwise put, if $C_G(g)=Z(G)$, then, since $g \in C_G(g)$, we get $g \in Z(G)$, whence $C_G(g)=G$, so $G=Z(G)$, which means $G$ is abelian. And if $G$ is abelian, then of course $C_G(g)=G=Z(G)$.