Suppose I have $X=X_1\cup X_2\cup…\cup X_n$ and $f:X \to Y$ where $Y$ has a similar decomposition.
Suppose I know that $f | X_{i_1}\cap…\cap X_{i_r} \to Y_{i_1}\cap…\cap Y_{i_r}$ is a homotopy equivalence for each nonempty intersection. Suppose that the spaces are nice enough that we have the homotopy extension property wherever we want it.
Then $f$ has a homotopy inverse preserving all of this structure and the homotopies themselves preserve the structure.
The isn't hard to prove by piecing together strong deformation retractions in mapping cylinders, but I'd rather just point to a reference.
For anyone who hasn't seen this stuff before, the base case is that if $f:(X,A) \to (Y,B)$ is a map such that $f:X \to Y $ and $f|:A \to B$ are homotopy equivalences, then $f$ is a homotopy equivalence of pairs. The proof is to form the mapping cylinder, squash the mapping cylinder of f| to it's top, keeping the whole top fixed, and then squash the rest. Of course, all of the spaces should be nice enough for the homotopy extension theorem to be available.