Having seen Lee Chung-yong capitalise on Cuellar's 11th-minute mistake Martin O'Neill admitted his side were sloppy as Marvin Sordell headed home the second just after half-time.
But the introduction of striker Connor Wickham turned the tie the Black Cats' way as within three minutes of coming on the 19-year-old scored his first goal since October 2011.
Craig Gardner's 25-yard piledriver set up a frantic finish with the visitors pushing for the winner.
Martin O'Neill: "I thought it was going to be difficult at the start but we certainly contributed to our potential downfall with the first goal.
"We were very sloppy in the first half but the match finally came to the boil in the last 35 minutes.
"I thought we did brilliantly to fight back.
"Connor was great. It was a great contribution, was good to get the goal and a great confidence booster for him.
"I think that is the first time he has been on the field with Steven Fletcher and although you can't make every judgement in 35 minutes but it looks like they could play together."