Upstream reciprocity refers to a person who has received help helping a third person instead of the person who helped him/her. It is observed widely but lacks a theory explaining its mechanism. Theory suggests that upstream reciprocity cannot maintain stable cooperation. Here we examine the possibility that the strength of a belief in a just world, which is a cognitive bias, drives upstream reciprocity. We test the effects on upstream reciprocity of a belief in a just world by conducting an upstream reciprocity game based on a trust game. The results demonstrate that upstream reciprocity is explained by a belief in immanent justice, a subconcept of a belief in a just world. These results shed light on a mechanism that explains why upstream reciprocity is observed in the real world.