Let $A\subseteq E$ have the property that $A\cap K$ is closed in $K$ for all compact $K\subseteq E$. We want to show that $A$ is closed whenever $E$ is locally compact Hausdorff, so we will show that $E\setminus A$ is open.
Let $x\in E\setminus A$, let $K$ be a compact neighbourhood of $X$, and let $U\subseteq K$ be an open neighbourhood of $x$. By hypothesis $A\cap K$ is closed in $K$, so $K\setminus A$ is open in $K$ which means that $K\setminus A\cap U$ is open in $U$ and thus in $E$, so $K\setminus A\cap U$ is a neighbourhood of $x$ disjoint from $A$, showing that $A$ is closed.
As an aside spaces in which a set is closed iff its intersection with all compact sets is closed are called $k$-spaces or compactly generated spaces. The above shows that locally compact Hausdorff spaces are compactly generated, and it turns out that being compactly generated is equivalent to being the quotient of a locally compact Hausdorff space.