I would put this in the possible but risky category. First of all your MIA-LIM flight must be on time. Second you have to worry about the time to be processed at immigration. I've experienced immigration at Lima taking under 30 mins from landing to immigration to baggage collection to taxi before, but I have also experienced it taking over 90 mins. The key is the length of the line at immigration. I haven't done it at 4:30am though. Maybe check how many other flights are arriving around the same time as yours as this gives you an idea into the likely length of the immigration line. To be honest, personally I would not attempt this unless your domestic flight can be changed for low or no penalty if things don't go your way (or if buying a new one one the day isn't too outrageous).