  The first aim of this paper is to study the $p$-local higher homotopy
commutativity of Lie groups in the sense of Sugawara. The second aim is to
apply this result to the $p$-local higher homotopy commutativity of gauge
groups. Although the higher homotopy commutativity of Lie groups in the sense
of Williams is already known, the higher homotopy commutativity in the sense of
Sugawara is necessary for this application. The third aim is to resolve the
$5$-local higher homotopy non-commutativity problem of the exceptional Lie
group $\mathrm{G}_2$, which has been open for a long time.
