The excellent answer by @runway64 gives a counterexample; I’d like to say a little more about the intuitions you sketch in the question.
Intuitively, if I have two topological groups in which their algebraic group structures are the same up to relabelling, and toplogical spaces that behave the same, it seems as though as topological groups they would have the same structure and behaviours, up to relabelling of course.
With a counterexample $G_1, G_2$, we know that their group structure is “the same up to relabelling”, and likewise their topological structure is “the same up to relabelling”. But the relabellings may be different! That is, we know there’s a group isomorphism $g : G_1 \to G_2$, and a homoeomorphism $h : G_1 \to G_2$. But as functions, $g$ and $h$ may be different, and there may be no function $G_1 \to G_2$ that is both a group isomorphism and a homeomorphism at the same time — as would be needed for them to be isomorphic topological groups.
Similarly, thinking about their behaviours: We know from the group isomorphism that they will have the same purely group-theoretic properties, and from the homeomorphism that they’ll have the same purely topological properties. But they may differ with properties involving the interaction of the group structure and topology: for instance, in @runway44’s counterexample, the property “the connected component of the identity is cyclic” holds in one of the two groups but not the other.