Hayes’ dramatic penalty in the 12th minute of time added on ensured the Chairboys remain in prime position for the third League Two automatic promotion spot.
The 31-year-old kept his cool to convert with the final kick of the game after Aaron Pierre was adjudged to have been pushed in the area by Tom Nichols.
Sam Saunders had given the hosts an early lead only for Liam Sercombe to head in a 76th-minute equaliser for the Grecians – before Ainsworth was left holding his breath at the death as his men finally tasted success at home on a Tuesday night game for the first time in two years.
“Wow. What a way to bury the jinx of Tuesday nights and that’s one for the boys because they have dug so deep here,” Ainsworth said.
“We lost players through injuries and had so much adversity but we’re at our best when we’ve got our backs to the wall.
“The silence in the stadium just before Hayesy took that penalty is something I’ve never heard before at Wycombe Wanderers so that was an eerie moment. To have his nerve is something that a captain would do and to slot that home for the points in fantastic.
“I think on chances we deserved the win but on possession maybe not. But the stat that I’m bothered about is the 2-1 and when you get to this stage of the season and you’re losing players left, right and centre the only stat that matters is the goals.
“I was up and down like you wouldn’t believe at the end. Matt Ingram’s save and then Saunders’ miss and Hogan Ephraim and Fred Onyedinma going through, it was like a basketball game out there.
“We don’t know when we’re beat. We’ve got our big centre-half doing his best at the end and he gets a break. It’s a fantastic result.”
As for Exeter manager Paul Tisdale, he was refusing to throw his toys out of his pram despite seeing his Grecians denied a point in the most thrilling of circumstances.
“That’s football,” Tisdale said.
“We played with the will to win in the second half and they played in equal measure so it’s likely to go one way or another.
“We wanted to go for the three points, which is how we’ve been playing recently. It would have been very easy to score the equaliser and shut up shop but we went for it and came very close to getting the winner.
“It is desperately disappointing but I’m very proud of the way we played. We played with extreme determination and vigour – we’ve lost but it’s not over yet. I believe we can still make the play-offs.
“The challenge on Graham Cummins in the first half wasn’t a penalty because it wasn’t given. If you ask me what I think should have happened, it should have been a penalty.
“It’s the same with Wycombe’s penalty at the end. No matter how minor the touch, Tom Nichols touched him so it’s a penalty.
“A few of the players have hobbled in so goodness knows what’s wrong with them but I hope it’s cramp. If not I’ll be putting out a very different side on Saturday.”