Question
I have a map $f: C \to D$ of chain complexes (of modules over some ring $R$) that I know is a quasi-isomorphism. (i.e. the induced map $f_*: H_*(C) \to H_*(D)$ is an isomorphism.)
I also have (bounded) filtrations of $C$ and $D$, and I know that $f$ respects these filtrations. (i.e. $f(\mathcal{F}_pC) \subseteq \mathcal{F}_pD$.)
Is there a necessary and sufficient third condition to ensure that $f$ induces a quasi-isomorphism on the associated graded complexes? (i.e. $(f_p)_*: H_*(\text{gr}_p(C)) \to H_*(\text{gr}_p(D))$ is an isomorphism for all $p$.)
What I've tried
A third condition is necessary because of counter-examples like $f: 0 \subseteq 4\mathbb{Z}\subseteq \mathbb{Z} \to 0 \subseteq 2\mathbb{Z} \subseteq \mathbb{Z}$ via the identity, where here I'm identifying a module $M$ with the chain complex $0 \to M \to 0$.
I believe strictness $f(\mathcal{F}_pC)=f(C)\cap\mathcal{F}_pD$ may be the correct condition, based on the Stacks Project page on filtrations here, but I can't seem to prove it myself (or come up with a counter-example).
Any help or advice would be appreciated. Thank you!
Edit: Loosening the question
Is this any easier if we let $R$ be a field? It's still not a trivial question as far as I can tell, because of the following example: let $C$ be a chain complex of $\mathbb{Q}$-vector spaces with basis $\{x,y\}$ and differential $d(x)=y$, $d(y)=0$. Let $\mathcal{F}_1$ be the filtration of $C$ given by $0 \subseteq \text{span}(y) \subseteq C$ and let $\mathcal{F}_2$ be the filtration of $C$ given by $0 \subseteq C \subseteq C$. Then the map $f: (C,\mathcal{F}_1) \to (C,\mathcal{F}_2)$ given by the identity is a quasi-isomorphism, and respects the filtrations, but does not induce a quasi-isomorphism on the associated graded complexes.
I've decided there is likely no nice (non-tautological) condition on $f$ to ensure that $f$ induces a quasi-isomorphism on associated graded complexes. Even assuming that $R$ is a field, that $f$ is strict, and that $f$ is either injective or surjective fails to imply what I want. This is demonstrated by the (embarrassingly simple) examples below.
Let $0$ be the zero chain complex, and let $(C,\mathcal{F}_1)$ be the complex defined in the edit to the question. Then the zero maps $0 \to C$ and $C \to 0$ are quasi-isomorphisms, respect the filtration, and are injective/surjective, respectively, but do not induce quasi-isomorphisms on the associated graded complexes.