No, I wasn't refering to which gate your AV plane will use in LIM –most likely a domestic one, since it is a domestic flight, and it will be re-boarded to head to another domestic destination– but on how is the boarding process done in CUZ. The same passengers can board a plane in CUZ in two different groups, depending on if they have a domestic or international destinations. If you have an international destination, you can they can direct you to passport control and customs, so officially you would be leaving the country in CUZ, and only transiting in LIM. Upon arrival at LIM, airport staff will direct you to the international side of the terminal and be forced to wait there. I guess that you could be allow out from that side, but that means re-enter the country in LIM, and pay the TUUA later in the night.
I've heard this happening on some LA flights departing from CUZ and connecting to OW flights (either AA or LA) during the last year, never with AV-UA. But knowing that this is possible, you would have to ask the AV staff in CUZ how will they proceed. If they don't force you to pass immigration at CUZ, then you are set for an experience in Lima (unless they don't check the bags to final destination, but there is baggage storage!). If they try to force you to pass them, you can find a way around the whole by asking the airport agent politely to check your bags to EWR but explain that you have, say, an important work meeting in LIM or visiting an ill friend, and that is why your choose this route with a long layover, to avoid exiting the country in CUZ. Not sure if they would, but airport staff can be very nice if you ask them nicely and do not demand things (also, don't be too midwestern about it, kind of suggesting but without asking it really, you know what I mean, that passive-agressive expectation for something that is not stated clearly that some northeners and teenagers have).