For more than an hour it seemed that Steed Malbranque's fifth goal in three games would deny the Gunners victory.
That was until Pires struck to sidefoot Francis Jeffers' stoppage time effort past Maik Taylor for his second goal of the match.
Fulham's Arsenal hoodoo had struck again with a vengeance. They have not beaten the Gunners since 1966.
After the game Wenger said: "We left it very late, but we have the mental strength to keep going and dig deep in these situations.
"We have great belief and confidence in our own quality. We felt a sense of frustration after we dropped two points in the last minute at Liverpool on Wednesday."
"Today we gained two points in the last minute after Fulham had given us very little space."
The Arsenal boss also praised substitute Jeffers, whose arrival lifted both colleagues and crowd.
"He made an impact as soon as he came on," he added.
Pires' decider was a triumph for the champions' persistence on a day when they struggled to find their usual fluency.
But Arsenal failed to capitalise and 12 minutes later Malbranque levelled with a stinging 20-yard volley after the home defence failed to clear.
Fulham defended in depth for most of the second half. Henry failed by inches to finish off Sylvain Wiltord's centre, Taylor then held Bergkamp's header and the Fulham keeper then foiled Jeffers.
When Taylor was beaten, Gilberto's 73rd-minute shot cannoned off a post. The champions' frustration was growing visibly until Pires had the last word.
Defeat leaves Fulham teetering on the brink of the relegation battle as they have won only three of their last 19 league games.