Definitely Wulfric. We see before the Gym Battle even happens that Sawyer had beaten him and had gained 7 badges, basically leaving Ash in the dust in terms of Gym Badges, which gave Ash even more of an incentive to win since this kid that basically idolises him had gotten ahead of him and was watching. When he lost the battle since he was still unable to control Ash-Greninja, it left him ashamed in the fact that he had let his partner down and embarassed since the novice trainer who worshipped the ground he walked on had improved so much more in such a small space of time, having a close bond with all his Pokemon.
This is when we see Ash's confident demeanor slip, begining to have an existential crisis and spending his time sulking in the woods alone. When Serena tries to talk with him, telling him that she knew what he was going through and was there to help, Ash yelled at her, basically telling her to leave him alone since she had no idea of how he felt. This caused Serena to cry and tell Ash that he was acting like a little ***** and that the real Ash would take this loss on the chin and use it to improve. This reality check caused Ash to see how out-of character he was being and how much his friends were worrying about him, causing him to find Greninja in the woods on his way back and to flashback to when he decided to become a trainer and master the Ash-Greninja form.
The next day, he re-challenges Wulfric with his new found skill and confidence and wins, using the experience as a motivator to keep trying his best, training hard and keeping his friends and Pokemon close to him.
Another instance where Ash is impacted by a stronger trainer is Paul, though I think that it's to a lesser extent than what happened with Wulfric. Losing to Paul in every battle he gets in with him makes Ash doubt whether his training ideology is correct or not, though he gets over this in time after seeing Cynthia beat Paul and beating Paul himself with the Pokemon that Paul thought was
worthless (Infernape), showing Paul that Pokemon need to be treated with respect and love to grow properly.
I also like to think that Ash's loss against Harrison in the Johto League proved to him that there are much stronger opponents out there and new Pokemon to catch (shown when Ash's Charizard was beaten by Paul's Blaziken). I say this because while he lost against Ritchie, it was due to Charizard's laziness and outside meddeling by Team Rocket that he did so (since I feel that Ash and Ritchie were equally as good as each other) and the fact that he beat Drake to win the Orange League, which he didn't take that much away from imo.