Rory Patterson struck just two minutes from time to seal Derry City's first league win at Turner's Cross since 2000 on Sunday night.
The Candystripes' leading goal scorer reacted quickest to score the rebound after goalkeeper Mark McNulty saved his penalty kick following a handball by Dan Murray.
The game looked headed for a draw after both sides cancelled each other out for the most part, with neither Gerard Doherty or McNulty overworked in the 90 minutes.
But the win, City's first league win in 13 years in Cork, was eventually sealed very late on for the visitors, with Patterson taking his tally for the season to five goals.
City started the game with an unfamiliar line up, with captain Kevin Deery, Stewart Greacen, Barry McNamee, Shane McEleney, Patrick McEleney and Paddy Kavanagh all unavailable.
As expected, midfielder Sean Houston was given his first start in a City shirt while highly-rated youngster Michael Duffy was drafted in.
Barry Molloy dropped back into full back in the absence of City's two regular centre halves, but despite being down to the bare bones, the visitors did well.
An entertaining opening saw both sides create early chances. Danny Murphy tested Ger Doherty, while Cork keeper Mark McNulty was forced to halt Mark Griffin's advances. Daryl Horgan had an excellent chance for the hosts on 10 minutes, but saw his strike fizz past the post. Ryan McBride had the best chance of the half for Derry, but couldn't direct his header on target.
The best chance of the half came to City's Michael Rafter, who came close to scoring yet another spectacular goal, his effort from distance just clearing the Cork upright with McNulty beaten.
City were the happier of the teams at half time, with Cork manager Tommy Dunne having his work cut out at half-time for his shot shy team.
Cork had to wait until 20 minutes from time before they created a goal-worthy chance, Horgan shooting wide of the target.
Derry were equally as frustrated at the other end, with Simon Madden shooting over.
The game seemed set to finish scoreless until Murray handled the ball inside the area, and although McNulty saved Paterson's penalty, the goalkeeper was powerless to prevent the striker hitting Derry's winner.
CORK: Mark McNulty, Danny Murphy, Kevin Murray (C), Gearoid Morrissey, Colin Healy, Shane Duggan, Daryl Kavanagh (Danny Morrissey 70 mins), Danny Furlong, John Dunleavy (Ian Turner 81'), Dan Murray, Daryl Horgan (Adam Rundle 81').
DERRY: Gerard Doherty, Barry Molloy (C), Ruaidhri Higgins, Marc Griffin, Rory Patterson, Ryan McBride, Michael Rafter (Ryan Curran 68 mins), Sean Houston, Simon Madden, Thomas Crawley, Michael Duffy