Let $q:(X,T)\to (X',T')$ be a continuous and surjective map. If $q$ is open or closed, then it is a quotient map.

Suppose that $q$ is open and let's check that $\bar q:\bar X\longrightarrow X'$ is open too (and therefore homeomorphism, because continuous and open bijections identify the open subsets of each space). Let $\bar U\subset \bar X$ be an open subset:

$\bar U=\pi(U)$ for some $U\subset X$ saturated open set ($U=\pi^{-1}(\bar U)$). Then $\bar q(\bar U)=\bar q(\pi(U))=q(U)$, which is open by hypothesis.

The case in which $q$ is closed is similar.

$\bar U=\pi(U)$ for some $U\subset X$ saturated open set ($U=\pi^{-1}(\bar U)$). Then $\bar q(\bar U)=\bar q(\pi(U))=q(U)$, which is open by hypothesis.

The case in which $q$ is closed is similar.