The pay-it-forward reciprocity is a type of cooperative behavior that people who have benefited from others return favors to third parties other than the benefactors, thus pushing forward a cascade of kindness. The phenomenon of the pay-it-forward reciprocity is ubiquitous, yet how it evolves to be part of human sociality has not been fully understood. We develop an evolutionary dynamics model to investigate how network homophily influences the evolution of the pay-it-forward reciprocity. Manipulating the extent to which actors carrying the same behavioral trait are linked in networks, the computer simulation model shows that strong network homophily helps consolidate the adaptive advantage of cooperation, yet introducing some heterophily to the formation of network helps advance cooperation's scale further. Our model enriches the literature of inclusive fitness theory by demonstrating the conditions under which cooperation or reciprocity can be selected for in evolution when social interaction is not confined exclusively to relatives.