In that instance even if he's off the pitch he's still offside. Just like if a defender stands behind the goal-line for a direct freekick [and then steps up onto it after the ball is played] he would be playing every attacking player onside (assuming the goalkeeper was where you'd expect him to be).
You can't be affecting the game or offside if you're off the pitch. The offsideness of an attacker is "when the ball is played"
If the defender claims the attacker was offside because the defender was behind the goalline, I believe the correct decision would be for the free kick to be retaken, and the defender to be cautioned for leaving the pitch without the referee's permission. (because he was seeking to gain an advantage by doing so in hoping the attacker would be offside) this is not the same as defending a corner etc.
Any qualified referees care to clear this up ?