If $X$ is a connected polyhedron, a point $x\in X$ is said to be a *global separating point* if $X-\{x\}$ is not connected.

**Theorem ([1], Theorem 7.1)**
In the category of compact connected polyhedra without global separating points, the fixed point property is a homotopy type invariant.

The example by Lopez mentioned in Vidit Nanda's answer shows that the hypothesis about global separating points is fundamental. This theorem is proved using Nielsen theory, which takes into account not only homology but also the fundamental groupoid.

Let $f:X \to X$ be a self map of a compact connected polyhedron. Two fixed points $x_0$, $x_1$ of $f$ are said to be *equivalent* if there is a path $c$ from $x_0$ to $x_1$ such that $c$ and $f\circ c$ are homotopic. A *fixed point class* of $f$ is an equivalence class of this relation (there is another definition using the universal cover of $X$ that takes into account also many empty fixed point classes). Each fixed point class has a number associated to it, its *index*, that measures the number of fixed points in that class. The sum of these indices, taken over the set of fixed point classes is the Lefschetz number of $f$ (Lefschetz-Hopf Theorem). The *Nielsen number* of $f$, $N(f)$ is the number of fixed point classes having nonzero fixed point index. The number $N(f)$ is a homotopy invariant of $f$ and therefore is a lower bound for the number of fixed points of any map homotopic to $f$. With some local hypotheses (see [1], Main Theorem) there is a map $g$ homotopic to $f$ having exactly $N(f)$ fixed points. To prove this, we can assume that $f$ has isolated fixed points (this goes back to Hopf). The local hypotheses are then used to combine two equivalent fixed points. Some references for this beautiful subject are [2] and [3].

[1] B. J. Jiang. *On the least number of fixed points*. Amer. J. Math., 102 (1980), 749-763.

[2] B. J. Jiang. A primer of Nielsen fixed point theory. Handbook of topological fixed point theory, 617--645, Springer, Dordrecht, 2005.

[3] B. J. Jiang. Lectures on Nielsen fixed point theory. Contemporary Mathematics, 14. American Mathematical Society, Providence, R.I., 1983. vii+110 pp.