Context. Several diagnostics ranging from the radio to the X-ray band are suitable for investigating the magnetic activity of late-type stars. Empirical connections between the emission at different wavelengths place constraints on the nature and efficiency of the emission mechanism and the physical conditions in different atmospheric layers. The activity of ultracool dwarfs, at the low-mass end of the main-sequence, is poorly understood. Aims. We perform a multi-wavelength study of one of the nearest M9 dwarfs, DENIS-P J104814.7-395606 (4 pc), to examine its position within the group of magnetically active ultracool dwarfs, and, in general, advance our understanding of these objects by comparing them to early-M type dwarf stars and the Sun. Methods. We obtained an XMM-Newton observation of DENIS-P J104814.7-395606 and a broad-band spectrum from the ultraviolet to the near-infrared with X-Shooter. From this dataset, we derive the X-ray properties, stellar parameters, kinematics, and the emission-line spectrum tracing chromospheric activity. We integrate these data by compiling the activity parameters of ultracool dwarfs from the literature. Results. Our deep XMM-Newton observation provides the first X-ray detection of DENIS-P J104814.7-395606 (log L x = 25.1), as well as the first measurement of its V band brightness (V = 17.35 mag). The flux-flux relations between X-ray and chromospheric activity indicators are here for the first time extended into the regime of the ultracool dwarfs. The approximate agreement of DENIS-P J104814.7-395606 and other ultracool dwarfs with flux-flux relations for early-M dwarfs suggests that the same heating mechanisms work in the atmospheres of ultracool dwarfs, albeit weaker as judged from their lower fluxes. The observed Balmer decrements of DENIS 1048-3956 are compatible with optically thick plasma in local thermal equilibrium (LTE) at low, nearly photospheric temperature or optically thin LTE plasma at 20 000 K. Describing the decrements with case B recombination requires different emitting regions for Hα and the higher Balmer lines. The high observed Hα/Hβ flux ratio is also poorly fitted by the optically thin models. We derive a similarly high value for the Hα/Hβ ratio of vB 10 and LHS 2065 and conclude that this may be a characteristic of ultracool dwarfs. We add DENIS-P J104814.7-395606 to the list of ultracool dwarfs detected in both the radio and the X-ray band. The Benz-Güdel relation between radio and X-ray luminosity of late-type stars is well-known to be violated by ultracool dwarfs. We speculate on the presence of two types of ultracool dwarfs with distinct radio and X-ray behaviors.