We study the evolution of cooperation in the evolutionary spatial prisoners dilemma game (PDG) and snowdrift game (SG), within which a fraction $alpha$ of the payoffs of each player gained from direct game interactions is shared equally by the immediate neighbors. The magnitude of the parameter $alpha$ therefore characterizes the degree of the relatedness among the neighboring players. By means of extensive Monte Carlo simulations as well as an extended mean-field approximation method, we trace the frequency of cooperation in the stationary state. We find that plugging into relatedness can significantly promote the evolution of cooperation in the context of both studied games. Unexpectedly, cooperation can be more readily established in the spatial PDG than that in the spatial SG, given that the degree of relatedness and the cost-to-benefit ratio of mutual cooperation are properly formulated. The relevance of our model with the stakeholder theory is also briefly discussed.