We consider a pair of collectively oscillating networks of dynamical elements and optimize their internetwork coupling for efficient mutual synchronization based on the phase reduction theory developed in Ref. [H. Nakao, S. Yasui, M. Ota, K. Arai, and Y. Kawamura, Chaos 28, 045103 (2018)]. The dynamical equations describing a pair of weakly coupled networks are reduced to a pair of coupled phase equations, and the linear stability of the synchronized state between the networks is represented as a function of the internetwork coupling matrix. We seek the optimal coupling by minimizing the Frobenius and L1 norms of the internetwork coupling matrix for the prescribed linear stability of the synchronized state. Depending on the norm, either a dense or sparse internetwork coupling yielding efficient mutual synchronization of the networks is obtained. In particular, a sparse yet resilient internetwork coupling is obtained by L1-norm optimization with additional constraints on the individual connection weights.