This is the missing ingredient towards answering my previous question.

Let $M$ and $N$ be path connected locally compact, locally contractible metric spaces (you may assume that they are manifolds). It seems the "correct" condition on $N$ is absolute neighborhood retract. Let us also assume that $M$ is $\sigma$-compact, i.e. a union of a sequence of compact sets (and then we can even assume that every compact set in $M$ is contained in an element of that sequence).

Let $\varphi:M\to N$ be such that for every compact $K\subset M$ the map $\varphi|_{K}$ is null-homotopic. Does it follow that $\varphi$ is in fact null-homotopic?

The intuition says that if there is a hole in $N$ such that $\varphi$ is wrapped around it, it should be wrapped already on some compact set.

Let me also add a specific case when $\varphi$ is identity map.

If $N$ is such that the inclusion of every compact $K$ is null-homotopic (meaning $K$ is contractible within $N$), does it follow that $N$ is contractible?