We develop the deformation theory of a Dirac–Jacobi structure within a fixed Courant–Jacobi algebroid. Using the description of split Courant–Jacobi algebroids as degree 2 contact NQ manifolds and Voronov's higher derived brackets, each Dirac–Jacobi structure is associated with a cubic L∞ algebra for any choice of a complementary almost Dirac–Jacobi structure. This L∞ algebra governs the deformations of the Dirac–Jacobi structure: there is a one-to-one correspondence between the MC elements of this L∞ algebra and the small deformations of the Dirac–Jacobi structure. Further, by Cattaneo and Schätz's equivalence of higher derived brackets, this L∞ algebra does not depend (up to L∞-isomorphisms) on the choice of the complementary almost Dirac–Jacobi structure. These same ideas apply to get a new proof of the independence of the L∞ algebra of Dirac structure from the choice of a complementary almost Dirac structure (a result proved using other techniques by Gualtieri, Matviichuk and Scott).