The 34-year-old, playing the final Barclays Premier League game of his loan spell from the New York Red Bulls, stabbed home Andrey Arshavin's injury-time cross to claim the points at the Stadium of Light.
"He finished the story of the legend in the championship. I hope he will add some in the Champions League on Wednesday," Wenger said after the game on the club's official website.
"But certainly, he got us the three points in a very difficult game."
Martin O'Neill's men had taken the lead when James McClean took advantage of Per Mertesacker's 70th-minute slip to run in on goal and fire past Wojciech Szczesny, although he could not have known the German had collapsed in agony after catching his studs in the turf.
Mertesacker, who had survived concerted first-half appeals for a penalty, was eventually replaced by Aaron Ramsey, who made his mark within minutes when he blasted home an equaliser off both posts.