Device-to-device (D2D) communication is a promising technology to improve spectrum efficiency, energy efficiency, and transmission delay due to proximity of user equipments (UEs). With cooperative D2D communications, a UE needs to select an optimal peer to act as a relay to forward data to the base station (BS). Therefore, it is essential to take into account the social relationships among UEs during peer selection so as to enhance data privacy. In this paper, we investigate a dynamic social-aware peer selection problem by formulating it as a dynamic optimization problem and proposing the drift-plus-penalty ratio algorithm to solve it. Simulation results show that the proposed peer selection scheme outperforms other existing schemes while keeping the handover frequency lower than others.