The evolutionary and ecological processes behind the origin of species are among the most fundamental problems in biology. In fact, many theoretical hypothesis on different type of speciation have been proposed. In particular, models of sympatric speciation leading to the formation of new species without geographical isolation, are based on the niche hypothesis: the diversification of the population is induced by the competition for a limited set of available resources. Interestingly, neutral models of evolution have shown that stochastic forces are sufficient to generate coexistence of different species. In this work, we put forward this dichotomy within the context of species formation, studying how neutral and niche forces contribute to sympatric speciation in a model ecosystem. In particular, we study the evolution of a population of individuals with asexual reproduction whose inherited characters or phenotypes are specified by both niche-based and neutral traits. We analyze the stationary state of the dynamics, and study the distribution of individuals in the whole phenotypic space. We show, both numerically and analytically, that there is a non-trivial coupling between neutral and niche forces induced by stochastic effects in the evolution of the population allowing the formation of clusters, that is, species in the phenotypic space. Remarkably, our framework can be generalized also to sexual reproduction or other type of population dynamics.