Upvote:2
Have you already used your UK visa to enter the UK, and are you still within the 180 days that were authorized when you last entered the UK? If so, you could be eligible for the short stay visa waiver program (also described on Wikipedia).
Otherwise, you need a regular Irish visa.
A transit visa isn't relevant because your second flight is within the Common Travel Area, so you have to pass border control after your first flight.
Note: My answer is based only on the Irish government official website and Wikipedia. It would be helpful if someone with real-life experience of this could add an answer as well.