Let $X$ be the real line with a doubled origin and $Y$ be $\Bbb R$, and let $f$ be the projection map that collapses the two origins $0^+$ and $0^-$ to $0$. Then any map $g: X \to Y$ satisfies $g(0^+) = g(0^-)$ because $\Bbb R$ is Hausdorff. Therefore, $f$ is not homotopic to any map that sends these two points to distinct ones.

Your question is closely related to the inclusion $\{x_1,\dots,x_n\} \subset X$ having the homotopy extension property. In particular, if it is the inclusion of a neighborhood deformation retract, then such homotopies exist. In the example above, each point individually has a contractible neighborhood but the two origins together do not have a neighborhood that retracts back onto them.