Given $f:A\to X$ and $g:B\to Y$, the map in your question is usually called the pushout product of $f$ and $g$, and often denoted $f\Box g$. The property in your question is very related to the pushout product axiom, which states that the pushout product of two cofibrations is a cofibration, and if either cofibration is in addition a weak equivalence then $f\Box g$ is too. This axiom is exactly what's needed to make sure that the monoidal structure on the point-set level descends to a monoidal structure on the homotopy category (more generally that the monoidal structure on a model category descends to a well-defined monoidal structure on the homotopy category). For spaces the monoidal structure is the Cartesian product and for pointed spaces it's the smash product. By the way, a lemma in Schwede and Shipley's Algebras and Modules in Monoidal Model Categories proves that it's sufficient to check the pushout product axiom on the generating (trivial) cofibrations, so the exercise about maps from spheres into disks will imply the pushout product axiom on all cofibrations. You get to general cofibrations by building them as retracts of transfinite compositions of pushouts of the generating ones, and this is very common in model categories.
Chapter 4 of Mark Hovey's book Model Categories proves that $k$-spaces, compactly generated spaces, and simplicial sets are all monoidal model categories, and so in particular the pushout product axiom is satisfied. Note that in these cases we do not need to say the cofibrations are closed. Wider classes of spaces (e.g. the Strom model structure on all of $Top$) do not form monoidal model categories because they don't have internal hom objects. You need the compactly generated hypothesis to be able to use the compact-open topology on hom sets. I thought you might be interested in this because you mentioned you were willing to restrict to a nice category of spaces, but perhaps you didn't want to restrict to closed cofibrations.
Mark Hovey's paper Monoidal Model Categories highlights why working with closed cofibrations is sometimes needed, in particular when one is trying to verify the monoid axiom (which has to do with when a model structure can be passed to the category of monoids).