It is a standard fact that the inclusion of a sub-CW-complex into a CW-complex is a cofibration, it follows from the fact that the inclusions $S^k\to D^{k+1}$ are, and that they are preserved by pushouts.
My question is about a general closed embedding of a CW-complex into another one, say $f:Y\to X$; but it's not necessarily cellular, and even if it were, it doesn't necessarily witness $Y$ as a sub-CW-complex of $X$.
Is it still necessarily a cofibration ?
If it helps/changes the answer, we may assume that $Y$ or both $X,Y$ are finite dimensional, or even finite (though if the answer is "yes" for one of these cases with more hypotheses and "no" with fewer hypothese, I would still be interested in counterexamples for fewer hypotheses)