Leicester City 1 Crystal Palace 0
A drab game appeared destined for a goalless stalemate until Dudley Campbell failed to connect with Matt Oakley's low cross to allow Hayles to bundle the ball home at the far post.
It was the first time City had recorded back to back home wins since August 2006.
The first chance of the game arrived after two minutes when Steve Howard headed Iain Hume's deep free-kick straight into the arms of the Palace keeper.
City's sustained pressure was rewarded with another opportunity on eight minutes when Howard drove over from 18 yards after John Halls failed to clear a Joe Mattock cross.
Leicester continued to menace with Hayles shooting just wide after a surging run.
The Londoners had to wait until the 27th minute for their first threat on goal, when Ben Alnwick was forced to punch away Ben Watson's inswinging corner from just beneath the bar.
The game had to wait until a minute before the break before either side fashioned a further chance with Zsolt Laczko just failing to connect with Mattock's dangerous cross and then Mark Hudson lifting Alnwick's punched clearance over the bar.
Leicester threatened twice within moments of the restart when first Hume whipped in a dangerous cross to the near post, where Laczko miscued his shot, before Hume fired a 20-yard free-kick into the sidenetting.
James Scowcroft responded for Palace, hoisting a half cleared Watson free-kick over the bar as both sides sought to quicken the pace of the game.
The Eagles did have the ball in the net midway through the second half but Clinton Morrison was ruled offside.
Gareth McAuley then deflected Clint Hill's drive just wide, before Howard directed a header from a Hume free-kick the wrong side of an upright.
With both teams seeming satisfied with a point apiece, up popped Hayles to give the Foxes victory.
Deep in time added on Campbell broke clear, but, with only the keeper to beat, he shot wide of the target to spurn a chance to add a second.