Mapping the network of ecological interactions is key to understanding the composition, stability, function and dynamics of microbial communities. These ecosystem properties provide the mechanistic basis for understanding and designing microbial treatments that attempt to promote human health and provide environmental services. In recent years various approaches have been used to reveal microbial interaction networks, inferred from metagenomic sequencing data using time-series analysis, machine learning and statistical techniques. Despite these efforts it is still not possible to capture details of the ecological interactions behind complex microbial dynamics. Here, we develop the sparse S-map method (SSM), which generates a sparse interaction network from a multivariate ecological time-series without presuming any mathematical formulation for the underlying microbial processes. We show that this method outperforms a comparative equation-based method and that the results were robust to the range of observational errors and quantity of data that we tested. We then applied the method to the microbiome data of six mice and found that the mice had similar interaction networks when they were middle- to old-aged (36-72 week-old), characterized by the high connectivity of an unclassified Clostridiales. However, there was almost no shared network patterns when they were young- to middle-aged (4-36 week-old). The results shed light on the universality of microbial interactions during the lifelong dynamics of mouse gut-microbiota. The complexity of microbial relationships impede detailed equation-based modeling, and our method provides a powerful alternative framework to infer ecological interaction networks of microbial communities in various environments.