The hosts had raced ahead inside the opening quarter of an hour through a brilliant free-kick from Robin van Persie and Philippe Senderos' close-range effort.
However, Sunderland pulled a goal back through Ross Wallace, and were then level after the break when Kenwyne Jones headed in.
Wenger decided to bring on England Under-21 winger Theo Walcott as the match headed into the final 30 minutes and his side were unable to get back in front.
The breakthrough eventually came - after Kolo Toure had hit the post from 30 yards and Walcott missed a sitter - when van Persie drilled in with 10 minutes left following good work from Walcott.
Sunderland finished the game with 10 men when Paul McShane was shown a straight red for clattering into Alexander Hleb with his knee when the Arsenal winger was on the floor.
Wenger felt it was an experience which will serve his young side well for the battles which lie ahead over the next seven months.
"After 15 minutes, the game looked to be easy and maybe we convinced ourselves of that as well," said Wenger.
"Part of our mental focus went - when you do that at this level, you pay for it.
"At the end of the day it was a good lesson for us maturing, because again we still found the resources which showed that there is something in the team which is really strong.
"It was the first time since we were at the top of the league that we had been a bit challenged."
However, the assistant referee flagged for what looked a poor offside decision against Mathieu Flamini in the centre.
The decision perplexed Wenger, who said: "Frankly, it was a third goal. I do not know how he could disallow that goal.
"It certainly would have changed the game completely at 3-0.
"You can only live with the decisions which are made.
"In the end we found the third goal, which always looked like it was coming, but sometimes you never know."
Wenger was impressed with the contribution of 18-year-old Walcott, who has worked back to fitness following a shoulder problem.
The Arsenal boss said: "I felt that we needed some pace to go in behind them, and Theo gave us something which certainly helped determine the result today."
Wenger, however, continues to urge cautious optimism for his side, which is now on their best run since the 2003/2004 season.
Wenger said: "It is too early, but what is a good sign is there is a great resilience in the team and that they do not panic.
"The potential is there to be very good, but the competition at that level in the Premier League is very difficult.
"We still had problems against Sunderland, who are down the league, and that shows we have to stay humble and work for each other."