We apply the Lagrangian method to study the post-Newtonian evolution of a compact binary system with environmental effects, including a dark matter spike, and obtain the resulting gravitational wave emission. This formalism allows one to incorporate post-Newtonian effects up to any desired known order, as well as any other environmental effect around the binary, as long as their dissipation power or force formulae are known. In particular, in this work, we employ this method to study a black hole–black hole binary system of mass ratio 105 by including post-Newtonian effects of order 1PN and 2.5PN, as well as the effect of relativistic dynamical friction. We obtain the modified orbits and the corresponding modified gravitational waveform. Finally, we contrast these modifications against the LISA sensitivity curve in frequency space and show that this observatory can detect the associated signals.