The question is in the title.
More precisely: let $A$ be a subspace of a topological space $X$. Then in topology we would say that $A$ is a retract of $X$ if there is a continuous map $r$ from $X$ to $A$ such that for all $a \in A$, $r(a) = a$. But the notion of "retraction" from category is a bit stronger: $A$ is called a retract of $X$ if there exists a continuous map $i : A \to X$ such that $r \circ i = id_A$. This map $i : A \to X$ doesn't need to be the inclusion of $A$ into $X$! That's the confusion.
If $X, Y$ are spaces with $i: X \to Y$ and $r: Y \to X$ continuous so that $ri = 1_X$, then the map $i$ is a topological embedding, meaning that if one restricts the codomain to $i(X)$ with the subspace topology one obtains a homeomorphism $$\bar i: X \to i(X).$$ (Proof: restrict the domain of $r$ to get a continuous inverse to this continuous bijection.)
Now $i(X)$ carries a canonical inclusion map, $j: i(X) \hookrightarrow Y$, and one may set $r' = \bar i r: Y \to i(X)$ to be the composite of the retraction and the homeomorphism to $i(X)$.
Then $r'$ is a retraction of $Y$ onto the subspace $i(X)$.
Not only is $X$ homeomorphic to a topological retract of $Y$, in fact the retraction diagram $(X, Y, i, r)$ is isomorphic in $\mathsf{Top}$ to a retraction diagram $(i(X), Y, j, r')$ in the topological sense. Therefore I do agree with the contention that these are really the same ideas. (The apparent generalization in the categorical definition comes from the desire to forget the idea of 'subobject', which may not be a good notion in arbitrary categories.)