Since Cohen introduced the notion of competition graph in , various variations have been defined and studied by many authors. Using the combinatorial properties of the adjacency matrices of digraphs, Cho . introduced the notion of a -step competition graph as a generalization of the notion of a competition graph. Then they computed the -step competition numbers of complete graphs, cycles, and paths. However, it seems difficult to compute the -step competition numbers even for the trees whose competition numbers can easily be computed. Cho . gave a sufficient condition for a tree to have the -step competition number two. In this paper, we show that this sufficient condition is also a necessary condition for a tree to have the -step competition number two, which completely characterizes the trees whose -step competition numbers are two. In fact, this result turns out to characterize the connected triangle-free graphs whose -step competition numbers are two.