Here is one solution which works even when you replace the closed unit interval with the closed unit $N$-ball $B$. I will describe steps of the proof and leave you to fill in the details. (Since the problem smells like a homework.)
(0). Prove the following lemma akin to the uniform continuity of continuous functions on compact metric spaces (and proven in a similar fashion):
Lemma. Let $f: (X,d_X)\to (Y,d_Y)$ be a continuous map between two compact metric spaces such that for every $y\in Y$, $diam(f^{-1}(y))\le \epsilon$. Then there exists $\sigma>0$ (depending on $f$ and on $\epsilon$) such that
$$
\forall x_1, x_2\in X, ~~~d_Y(f(x_1), f(x_2))<\sigma \Rightarrow d_X(x_1, x_2)< 2\epsilon.
$$
Proof. Suppose the claim fails. Then for every natural number $n$ there exists a pair of points $x_n, x'_n\in X$ such that $d_X(x_n, x'_n)\ge
2\epsilon$ while
$$
d_Y(f(x_n), f(x'_n))<\frac{1}{n}.$$
In view of compactness of $X$, after passing to a subsequence, we can assume that
$$
\lim_{n\to\infty} x_n=x, \lim_{n\to\infty} x'_n=x',
$$
with $d_X(x,x')\ge 2\epsilon$, while
$$
\lim_{n\to\infty} f(x_n)= \lim_{n\to\infty} f(x'_n)=y\in Y,
$$
and $f(x)=f(x')=y$. Thus, the preimage of $y$ has diameter $\ge 2\epsilon$. A contradiction. qed
(1). Given $f$ and $g$ as in your problem ($f$ is surjective and $diam(f^{-1}(y))<\epsilon$ for all $y\in B$), construct a piecewise-linear continuous map $h: B\to B$ such that the following diagram is "almost commutative":
$$
\require{AMScd}
\begin{CD}
X @>{g}>> X\\
@VVfV @VVfV \\
B @>{h}>> B
\end{CD}
$$
meaning that $d(f\circ g, h\circ f)<\delta(\epsilon)$, where
$$
\lim_{\epsilon\to 0}\delta(\epsilon)=0.
$$
I will explain how to do this in the case $B=[0,1]$, the extension to the case when $B$ is higher-dimensional is quite straightforward.
In order to construct such $h$ first pick a finite subset $0=y_0< y_1 < y_2 < ... <y_n\in [0,1]$ (with $|y_i- y_{i-1}|$ sufficiently small for all $i$) such that
$$
\forall i\in \{1,...,n\}, ~~diam(f^{-1}([y_{i-1}, y_i])) < 2\epsilon
$$
Then define $h$ on the finite subset $\{y_0,...,y_n\}$ so that
$$
\forall y_i, \exists x_i\in f^{-1}(y_i), h(y_i)=fg(x_i).
$$
Then extend $h$ to the rest of $[0,1]$ linearly on each interval $[y_{i-1},y_i]$.
(2). Use the fact that $B$ has the fixed point property to show that $g$ "almost" has a fixed point, i.e.: For every $\epsilon>0$ there is a point $x\in X$ such that $d(g(x), x)\le \eta(\epsilon)$, where
$$
\lim_{\epsilon\to 0}\eta(\epsilon)=0.
$$
To prove this, take $y\in B$ such that $h(y)=y$ and think of its preimage $f^{-1}(y)$.
(3). Conclude that there is a sequence $(x_n)$ in $X$ such that
$$
\lim_{n\to\infty} d(g(x_n), x_n)=0.
$$
(4). Use compactness of $X$ to show that $g$ has a fixed point in $X$.