Welcome to Just Answer and thanks for your question. Liver damage from alcoholism is an ongoing and cumulative problem. It can take months to years after someone has their last drink for liver function to actually improve to normal levels, if it ever does. It depends on how much damage has been done to the liver from the alcohol.
If you are referring to etg testing, it can be detected at least 5 days after the last drink and even longer depending on how much and how often someone has used alcohol. Etg is a metabolite of alcohol that is detectable for a very long time after alcohol use. It is generally only done on people in court-mandated alcohol rehab programs where use of alcohol can get them sent to jail.
It depends on what you mean by "trouble." If you are in an alcohol rehab program voluntarily, and not subject to etg testing, you wouldn't test positive 5 days later. If you are subject to etg testing, you may very well test positive even 5 days later.