Multijet events at large transverse momentum ($p_\mathrm{T}$) are measured at $\sqrt{s}$ = 13 TeV using data recorded with the CMS detector at the LHC, corresponding to an integrated luminosity of 36.3 fb$^{-1}$. The multiplicity of jets with $p_\mathrm{T}$$>$ 50 GeV that are produced in association with a high-$p_\mathrm{T}$ dijet system is measured in various ranges of the $p_\mathrm{T}$ of the jet with the highest transverse momentum and as a function of the azimuthal angle difference $\Delta\phi_{1,2}$ between the two highest $p_\mathrm{T}$ jets in the dijet system. The differential production cross sections are measured as a function of the transverse momenta of the four highest $p_\mathrm{T}$ jets. The measurements are compared with leading and next-to-leading order matrix element calculations supplemented with simulations of parton shower, hadronization, and multiparton interactions. In addition, the measurements are compared with next-to-leading order matrix element calculations combined with transverse-momentum dependent parton densities and transverse-momentum dependent parton shower.