NOTATION
$$ S_X\ :=\ \{\emptyset\ X\} $$ $$ D_X\ :=\ 2^X\ =\ \{A:\ A\subseteq X\} $$
Given an arbitrary set $\ X,\ $ topology $\ S_X\ $ is the smallest (the weakest) topology in $\ X;\ $ and the discrete topology $\ D_X\ $ is the largest (the strongest) topology in $\ X.$
Here is a logically initial modest positive result:
Theorem Let set $\ X\ $ be finite. Then for every non-discrete topological space $\ (Y\ T)\ $ (i.e. $\ T\ne D_Y),\ $ if monoids $\ \text{End}(X\ S_X)\ $ and $\ \text{End}(Y\ T)\ $ are isomorphic then topological spaces $\ (X\ S_X)\,$ and $\,(Y\ T)\ $ are homeomorphic, i.e. $\,\ |Y|=|X|\ $ and $\ T=S_Y.$
Proof If two monoids are isomorphic than they have the same number (cardinality) of constants (of the left-absorbing elements). Furthermore, the number of points of an arbitrary topological space is equal to the number the constants of its monoid of continuous self-maps.
Let's assume that monoids $\ \text{End}(X\ S_X)\ $ and $\ \text{End}(Y\ T)\ $ are isomorphic. Then
$$ |X|\ =\ |Y| $$
Also, $$ |\text{End}(X\ S_X)|\ =\ |\text{End}(Y\ T)|\ $$ hence
$$ |\text{End}(Y\ T)|\ =\ |\text{End}(X\ S_X)| \ =\ |X^X| $$ so that $$ |\text{End}(Y\ T)|\ =\ |Y^Y| $$
This means that $\ T=S_Y\ $ or $\ T=D_Y\ $ hence, by theorem's assumption, $\ T=S_Y\ $ -- otherwise $\ T\ $ would be not discrete nor the smallest, i.e. there exists $\ G\ \in\ T\setminus S_Y\ $ and non-isolated $\ p\in Y\ $ (i.e. such that $\ \{p\}\not\in T)$. Then consider $\ f:Y\to Y\ $ such that $ f(p)\in G\ $ and $\ f(Y\setminus\{p\})\subseteq Y\setminus G.\ $ Such $\ f\ $ is not continuous in $\ (Y\ T),\ $ hence $$ |\text{End}(Y\ T)|\ <\ |Y^Y| $$
-- a contradiction. End of PROOF
Remark For every set $\ X,\ $ monoids
$$ \text{End}(X\ S_X)\quad \text{and}\quad \text{End}(X\ D_X)\ $$
are isomorphic while the respective topological spaces $\ (X\ S_X)\ $ and $\ (X\ D_X)\ $ are not homeomorphic whenever $\ |X|>1.$