BET-protein-inhibiting, in particular BRD2-, BRD3- and BRD4-inhibiting 4-substituted pyrrolo- and pyrazolo-diazepines, of general formula I in which X, Y, n, m, p, R1, R2, R3, R4 and R5 have the meanings indicated in the description, pharmaceutical agents containing the compounds according to the invention and the prophylactic and therapeutic use thereof for treating hyperproliferative diseases, in particular tumor diseases, are described. Furthermore, the use of the compounds according to the invention as BET-protein inhibitors in benign hyperplasias, in atherosclerotic diseases, in sepsis, in autoimmune diseases, in vascular diseases, in viral infections, in neurodegenerative diseases, in inflammatory diseases, in atherosclerotic diseases and for controlling fertility in males is described.