  We construct clustering positive solutions for a perturbed critical elliptic
equation on a closed manifold of dimension $n=4,5$. Such a construction is
already available in the literature in dimensions $n\ge 6$ (see for instance
[8,12,27,29,33]) and not possible in dimension $3$ by [25]. This also provides
new patterns for the Lin--Ni [21] problem on closed manifolds and completes
results by Br\'ezis and Li [6] about this problem.
