A drilled shot by experienced Slovenia international Milivoje Novakovic threatened to leave Aberdeen with an uphill task in next week's return leg.
But Republic of Ireland international Hayes finally converted one of the many chances the Dons created at Pittodrie.
However, Aberdeen will need to score in Slovenia to stay in the tie.
All seven of the Dons' goals in the previous two rounds had come in the last 22 minutes of matches, with three in stoppage time.
And though there was a constant threat from Derek McInnes' side, full of pace, movement and intensity, they could not find a way past goalkeeper Jasmin Handanovic until the closing stages.
The aim from McInnes was to disrupt a team who like to slot into a steady defensive pattern in an effort to get an early goal.
Top scorer Adam Rooney fastened on to a mistake by Dare Vrsic, but the striker's shot was indecisive and Handanovic saved at the second attempt.
The visitors then squandered the best early chance after a great run and cross on the counter-attack by right-back Denis Sme, Marwan Kabha sending his shot from 12 yards hopelessly over the bar when he should have scored.
Handanovic made a brave block at Rooney's feet and then saw the same player miss an excellent Andrew Considine delivery by inches as crosses kept flashing across his penalty box.
The keeper again excelled by blocking Jayden Stockley's header at point-blank range just before the break.
Vrsic caused a few moments of anxiety for Aberdeen when stopper Joe Lewis was forced to make a sharp dive to his left to prevent the former Austria Vienna player netting.
Rooney did have the ball in the net after some great build-up play by Niall McGinn but the striker had strayed offside. Then, with time running out, Novakovic struck.
It was a wonderful finish from the 37-year-old as he brushed off the challenge of Ash Taylor before arrowing a shot beyond the despairing dive of Lewis.
But Taylor redeemed himself with a determined contribution to set up Hayes' sidefoot finish minutes later.
That gives Aberdeen greater hope of reaching the play-off round, but Maribor know they will progress if they avoid losing a goal next week.

For the half year to 30 September, lending was up 14% to Â£14.9bn, and profits rose to Â£802m
However, it said that it expected "downward pressure" on its profit margins in its second half and next year due to "robust" competition.
It added that incoming chief executive Joe Garner will take up his position in the spring.
"This has been our best ever half year of mortgage lending along with a strong inflow of savings and the opening of over a quarter of a million new current accounts," said chief executive Graham Beale.
"Mutuals, like Nationwide, are different from the banks... Nationwide is evidence that you can be successful by doing the right thing," he added.
The building society said in its outlook that healthy employment growth and "robust demand from investors" - including buy to let - had driven up prices, especially in London.
But it warned that "such outperformance is unlikely to be sustained over the long term, given that key measures of affordability are already stretched".
Aberdeen struck late in Europe again as Jonny Hayes equalised against Maribor in the Europa League third qualifying round first leg.
[NEXT_CONCEPT]
Nationwide has reported a record amount of mortgage lending for a six-month period and a 34% rise in profits.