Previous research has shown that ingroup cooperation tends to flourish in intergroup conflict situations. However, the free-rider problem remains unsolved, even in intergroup conflict situations. In this study, based on multi-group selection theory and cultural-group selection theory, we hypothesized that conformity (frequency-dependent behavior) may contribute to enhancing ingroup cooperation. The results of an evolutionary simulation revealed that ingroup cooperation and conformity can evolve in situations of intergroup conflict. When such conflict is mild, agents who cooperate with ingroup members and adjust their behavior to ingroup cooperation rates facilitate cooperation in their own group. However, no effect of conformity on ingroup cooperation was observed during intense intergroup conflict, even though conformity continued to evolve. We discuss the implications of these results and suggest avenues for future research.