I was wondering if there is an example of a nonabelian group $G$ with exactly five subgroups. Let $G$ be a such group, and let $a,b\in G$ be such that $ab\ne ba$. Let us concentrate on the subgroups $\langle a\rangle, \langle b\rangle, \langle ab\rangle$ and $\langle ba\rangle$.
If $a$ commute with $ab$ or $ba$, then $a$ would commute with $b$, and similarly for $b$ instead of $a$. Therefore the only possible inclusion between our cyclic subgroups is between $\langle ab\rangle$ and $\langle ba\rangle$; in particular none of the considered cyclic subgroups can be equal to $\{e\}$ or $G$.
Thus, the three nontrivial proper subgroups of $G$ are $\langle a\rangle, \langle b\rangle$ and $\langle ab\rangle=\langle ba\rangle$, and $G=\langle a,b\rangle$. Each one of these three subgroups must have prime order and they intersect trivially. Finally, $G$ must be finite (every group with finitely many cyclic subgroups is finite; prove it!) and $|G|$ is multiple of at most three primes.
Any ideas to "concretize" this hypothetical group?
If exactly $3$ primes divide the order of the group, then the order must be $pqr$, since if the square of any of the primes, say $p$, divided the order, the Sylow-$p$ would have at least $2$ nontrivial subgroups, which would give at least $6$ total subgroups.
Now, there is exactly $1$ Sylow-$p$, Sylow-$q$, and Sylow-$r$, so they must all be normal, which means that this group is $C_{pqr}$, a cyclic and abelian group. But note that this has $8$ subgroups.
Now, assume only $2$ primes divide the order. Either the order is $pq$ or $p^2 q$. In the former case, there must be exactly $2$ subgroups of order $p$ and $1$ of order $q$, WLOG. But then we'd have that $2\equiv 1 \ \text{mod} \ q$, which is impossible. Thus, the order must be $p^2q$. This means the Sylow-$p$ can only have $2$ nontrivial subgroups, so it must be $C_{p^2}$. Since both Sylow's are, again, unique and thus normal, this group is $C_{p^2 q}$. But note that this doesn't even work, despite being abelian, since this group has $6$ subgroups.
The final case is where we have a $p$ group. Since a group of order $p^n$ has subgroups of all possible $n+1$ orders, the order is at most $p^4$. If the order is $p^4$, then since the group has a unique subgroup of every divisor of the order, it's cyclic. If the order is $p^3$, and the group is nonabelian, then the center must have order exactly $p$, and quotienting out by it must give $C_p\times C_p$, since if the quotient by the center were cyclic, the group would be abelian.
But $C_p\times C_p$ itself has $p+1$ subgroups of order $p$, which gives $p+1$ subgroups of order $p^2$ in the original group. This is too many, since we only have room for one extra subgroup.
Finally, every group of order $p$ or $p^2$ is abelian.
Thus, there is no nonablian group with exactly $5$ subgroups. In fact, it seems that the only abelian groups with $5$ subgroups are the cyclic groups of order $p^4$, and the Klein-Four group.