A necessary and sufficient condition for a surjective map to be closed Let $X$ and $Y$ be topological spaces.
Say a map $f: X \rightarrow Y$ has property $\mathcal{P}$ if:
"Given any subset $S \subset Y$ and any open $U$ containing $f^{-1}(S)$, there exists an open $V \supset S$ such that $f^{-1}(V) \subset U$."
To show: a surjective map $p: X \rightarrow Y$ is closed iff it has property $\mathcal{P}$.
Progress: I have shown the implication "$\Rightarrow$".
For the implication "$\Leftarrow$" I have tried this:  
Let $A \subset X$ be closed. Let $S:= Y \setminus p(A)$. Then $p^{-1}(S) \subset X \setminus A$, which is open. We get a $V \supset S$ open with $p^{-1}(V) \subset X \setminus A$. Noting that map of sets $p \circ p^{-1}$ is the identity (by surjectivity) we obtain 
$$Y \setminus p(X\setminus A) \subset Y \setminus V \subset p(A). $$
The set in the middle is closed, so to show $\overline{p(A)} \subset p(A)$ it suffices to have $p(A) \subset Y \setminus p(X \setminus A)$. But this requires injectivity.
Have I chosen the wrong $S$? Or is the condition actually not sufficient?
Many thanks for your help.
 A: You appear to have started out correctly, but have just missed the conclusion.
To recap:

$A \subseteq X$ is closed, and $p^{-1} ( Y \setminus p(A) ) \subseteq X \setminus A$, and $X \setminus A$ is open. So by property $\mathcal{P}$ there is an open $V \subseteq Y$ with $Y \setminus p(A) \subseteq V$ and $p^{-1} ( V ) \subseteq X \setminus A$.

Rewrite the last two set inclusions as $Y \setminus V \subseteq p ( A )$ and $A \subseteq X \setminus p^{-1} ( A )$, and now note that $$Y \setminus V \subseteq p ( A ) \subseteq p ( X \setminus p^{-1} ( V ) ) = p ( p^{-1} ( Y \setminus V ) ) = Y \setminus V.\tag{1}$$
This means that $p ( A ) = Y \setminus V$, and is therefore closed.
(Without the surjectivity condition the last equality in (1) is a $\subseteq$ inclusion, and so the surjectivity condition is not actually required.)

As there appears to be some argument as to whether the surjectivity condition is required, I'll just fill out a proof of the other direction without using surjectivity.

Suppose that $f : X \to Y$ is a closed mapping, let $S \subseteq Y$, and let $U \subseteq X$ be open with $f^{-1} ( S ) \subseteq U$. Then $X \setminus U$ is closed, so $f ( X \setminus U )$ is closed in $Y$. It also follows that $S \cap f ( X \setminus U ) = \emptyset$. But then $Y \setminus f ( X \setminus U )$ is open and $S \subseteq Y \setminus f ( X \setminus U )$. As $A \subseteq g^{-1} ( g ( A ) )$ holds for all functions $g$ and all sets $A$ it follows that $$f^{-1} ( Y \setminus f ( X \setminus U ) )
= X \setminus f^{-1} ( f ( X \setminus U ) )
\subseteq  X \setminus ( X \setminus U ) = U.$$
  So $V = Y \setminus f ( X \setminus U )$ is as required.

