The relationship between the topology of a network and specific types of dynamics unfolding in networks constitutes a subject of substantial interest. One type of dynamics that has attracted increasing attention because of its several potential implications is opinion formation. A phenomenon of particular importance, known to take place in opinion formation, is echo chambers’ appearance. In the present work, we approach this phenomenon, while emphasizing the influence of contrarian opinions in a multi-opinion scenario. To define the contrarian opinion, we considered the Underdog effect, which is the eventual tendency of people to support the less popular option. We also considered an adaptation of the Sznajd dynamics with the possibility of friendship rewiring, performed on several network models. We analyze the relationship between topology and opinion dynamics by considering two measurements: opinion diversity and network modularity. Two specific situations have been addressed: (i) the agents can reconnect only with others sharing the same opinion; and (ii) same as in the previous case, but with the agents reconnecting only within a limited neighborhood. This choice can be justified because, in general, friendship is a transitive property along with subsequent neighborhoods (e.g.,~two friends of a person tend to know each other). As the main results, we found that the Underdog effect, if strong enough, can balance the agents’ opinions. On the other hand, this effect decreases the possibilities of echo chamber formation. We also found that the restricted reconnection case reduced the chances of echo chamber formation and led to smaller echo chambers.