I did the measurements with the headphones on my head but the mic was not inside my ear, it was just close, so I guess they would reflect the in-ear response.
If I understand you correctly I should first use an inverse of the DF curve, and then EQ to flat sounding with sweeps? But in this case it would only work if a headphone was DF equalized in the first place, wouldn't it?
I did similar thing with an IEM, I listened to log and linear sweeps to EQ it to flat sounding, then added the DF curve and the tonality is really nice now, so in this case it kinda worked.
If you're measuring at the EAM and not the eardrum, just EQ the response so it matches a blocked-meatus DF reference. Don't try to EQ it to flat because your ear does not have flat response.