Yes this is possible with an automation, not with a trigger. Triggers only react when something happens. Automations run at scheduled times and check for conditions. You have to create an automation that checks your tickets with last contact agent before 5 days.
Hey,
in my opinion it would be easier to set the state of the ticket to “close at time(5days)” and then answer the customer. if you get an answer, the ticket state will be changed to “open” again.