You will not need a transit visa for Dublin if your flight arrives and your onward connecting flight departs between 0400 and 1600. Yours does based on the information you have provided. You pass through flight connections and remain airside.
Of course you will need to have paperwork showing your entitlement to enter the UK. If you do not have this you will net be permitted to enter either country.