The home side finished with just eight men on the pitch in a game that saw Derry having to come from 2-1 behind.
City actually took the lead through Ryan McBride on 11 minutes.
Alan McNally equalised following a corner for the Louth outfit on 23 minutes and then on the half-hour mark Peter McGlynn was sent off for a dangerous tackle on Dean Jarvis.
Shame Grimes was then shown a straight red card two minutes after the break for dissent to leave Drogheda down to nine-men.
Remarkably, though, they took the lead with Mick Daly heading past Gerard Doherty.
It was then backs to the wall stuff for the home side but Derry finally drew level as Philip Lowry found the target in the 83rd minute.
More drama was to follow with Holohan getting a second yellow for kicking the ball away on 90 minutes but the Damien Richardson managed side held on despite six minutes of stoppage time.
The sides will now meet in the replay at the Brandywell on Tuesday night.
Elsewhere in the cup, Shamrock Rovers and Dundalk drew 0-0 while St. Pat's beat Bohemians 3-2.
Finn Harps travel to Cork to play Avondale United in the other tie on Sunday.