Each association is allowed up to 5 CL entrants. However the 5th will only be allocated if the winner of CL and/or EL are already qualified (ie finished in top 4).
So, we finish in top 4 and win CL and Liverpool don't win EL = just the top 4 qualify as normal
we finish top 4, win the CL and Liverpool win EL = top 4 qualify + Liverpool
we finish top 4 don't win CL and Liverpool win EL = as above
we finish outside top 4 and win CL and Liverpool don't win EL = top 4 qualify + us
we finish outside top 4 and win CL and Liverpool win EL = top 3 qualify + us + Liverpool
Note the last one is the only way 4th can be eliminated from qualifying and as for your specific question 5th cannot ever qualify on its own, only if it happens to be also a team that has won either CL or EL (in which case it matters nor whether they are 5th, 6th or 20th)
And breathe