More generally consider $f:S^n\to S^n$ and let $P\in S^n$ be such that $P\not\in f(S^n)$. For any $\theta\in S^n$ we have a homotopy
$$H:I\times S^n\to S^n$$
$$H(t, s)=\pi^{-1}\big(t\cdot \pi(f(s))+(1-t)\cdot \pi(f(\theta))\big)$$
where $\pi:S^n\backslash\{P\}\to\mathbb{R}^n$ is the stereographic projection which is a homeomorphism. Note that $H$ is well defined, continuous and we have
$$H(0, s)=f(\theta)$$
$$H(1, s)=f(s)$$
$$H(t,\theta)=f(\theta)$$
Finally since $\theta$ was arbitrary then all you need now is a fixed point $f(\theta)=\theta$. And the existance of such point follows from the Brouwer's fixed point theorem as you've mentioned yourself.
As mentioned in the comments, if $Y$ is contractible, then any map $f:Y\rightarrow X$ is nullhomotopic. So, in particular, the covering projection $\mathbb{R}\rightarrow S^1$ is an example where $X$ is non-contractible, $f$ is surjective, and $Y$ is contractible.
There are some exceptions, but generally speaking, surjectivity is not well behaved under homotopies: two maps can be homotopic with one being surjective and the other not being surjective.
Here's a large class of examples.
Proposition: Suppose $M$ and $N$ are connected compact manifolds. If $M$ has positive dimension, then there is a surjective null homotopic map $f:M\rightarrow N$.
Proof: Choose $p \in M$ and let $U$ be a closed neighborhood of $p$ which is homeomorphic to a closed ball. Abusing notation, I will identity $U$ with a ball of radius $1$ centered about $0$ in $\mathbb{R}^n$. Now, there is a surjective continuous function $f:U\rightarrow [-1/2,1/2]$ which is constantly $0$ on the boundary of the ball. For example, you can define identify $[-1/2,1/2]$ as a small part of a coordinate axis in $U$, define $f:[-1/2,1/2]\rightarrow [-1/2,1/2]$ as the identity, $f:\partial U\rightarrow [-1/2,1/2]$ as constantly zero, and then use the Tietze extension theorem to define $f$ on all of $U$.
Now, $f$ extends to a surjective continuous map $F:M\rightarrow [-1/2,1/2]$ by defining it to be $0$ outside of $U$.
Armed with $F$, we now use the Hahn-Mazurkiewicz theorem which says that a Hausdorff space $N$ is the continuous image of $[-1/2,1/2]$ if $N$ is compact, connected, locally connected, and second countable. All of these hypothesis are true for a connected compact manifold $M$ (and even a much larger class of spaces!). Then the composition $M\rightarrow [-1/2,1/2]\rightarrow N$ is surjective by construction. Note that the composition factors through a coontractible space, so is null homotopic. $\square$
However, this is not to say that surjectivity has nothing to do with whether or not a map is null homotopic. For example,
Proposition. Suppose $M^n$ and $N^n$ are compact oreintable connected $n$-manifolds with no boundary. Suppose $f:M\rightarrow N$ is continuous and that the induced map $H^n(M;\mathbb{Z})\rightarrow H^n(N;\mathbb{Z})$ is non-zero. Then any map $g$ which is homotopic to $f$ must be surjective.
Proof: As $H^n(M;\mathbb{Z})\cong \mathbb{Z}$, the induced map is given by multiplication by some integer called the degree of the map. The degree can be computed by homotoping a map to be smooth, and then doing a signed count of preimages of a regular value. If $g$ is not surjective, any point which is not in the image of $g$ is a regular value, so $g$ has degree $0$. Homotopic maps induce the same map on cohomology, so $f$ also has degree $0$. $\square$
Best Answer
There is a proposition that you will want to use here which is the following:
Now, if $f\colon S^1\to S^1$ is null-homotopic, let us suppose that it does not have a fixed point. Let $i\colon S^1\to D^2$ be the inclusion of the circle into the disk $D^2$. Let $\tilde{f}\colon D^2\to S^1$ be the extension of $f$ that must exist by the above proposition. Clearly if $f$ has no fixed points, then $$i\circ \tilde{f}\colon D^2\to S^1 \to D^2$$ also has no fixed points but this contradicts Brouwer's fixed-point theorem.