Quasi-isomorphisms and Subalgebras

Let $A$ and $B$ $dg$-algebras over $\mathbb{C}$. If there exists an isomorphism $f:A\to B$, then every subalgebra $A'$ of $A$ is isomorphic to the subalgebra $f(A')$ of $B$.

What is if $f$ is only a quasi-isomorphism? Can I relate $A'$ somehow to $f(A')$ if $A$ and $A'$ are sufficiently nice?

In particular I am interested in subalgebras of formal $dg$-algebras. Are there nice conditions when a subalgebra of a formal $dg$-algebra is formal again?

-