Nanonetworks, which are composed of interacting nanonodes, have significant potential in many areas and applications. However, reliable communication is extremely challenging in electromagnetic (EM) nanonetworks as a result of limited transmission power, constrained nanonode capabilities, and severe path losses in terahertz band communications. In this paper, we propose a cooperative communication model for hierarchical cluster-based nanonetworks. In each cluster, there is a nano-controller that acts as a cluster head and several nanonodes that cooperatively forward packets to the nano-controller. Based on the cooperative communication model, an energy-efficient cooperative routing algorithm with optimal link cost is proposed for the nanonetworks. We first formulate the energy cost of cooperative communication between two nanonodes with a two-stage transmission strategy, as only statistical knowledge about the channel is currently available. Using the energy cost formulation, we can then establish cooperative communication transmission with optimal energy consumption. The results of the study show that the cooperative routing scheme can effectively reduce energy consumption compared to noncooperative routing schemes, thus showing great potential for use in cooperative communication schemes to enhance the performance of the nanonetwork.