VIDEO: Ireland U21 2-0 Slovenia U21
Noel King's young starts had to wait until the 87th minute to go ahead as Everton's Charsley swept home from close range before Maguire's stoppage time penalty.
On a warm summer evening in Waterford, Noel King's side settled well and should have took an early lead in the sixth minute. Eoghan O'Connoll's cross was only cleared as far as the energetic Charsley, but his goal-bound shot was well blocked.
Eoghan O'Connell has recently caught the eye in Celtic hoops and he turned in another impressive performance in front of the watching Martin O'Neill.
It was his cross which created the major chance of the first-half just past the half-hour when he picked out QPR's Olamide Shodipo, on his first appearance for the Under-21s, but he could only scoop his effort over the bar from six yards out.
As dusk began to set in the second-half, Ireland almost went ahead with 30 minutes remaining. Cork City's impressive Kevin O'Connor picked out Charsley at the back-post but he placed his header wide.
With 12 minutes remaining, Shodipo almost netted his first goal for Ireland when he collected Courtney Duffus' pass to round his defender on the edge of the area but goalkeeper Grega Sorcan did well to tip his powerful effort over.
From the corner, Shodipo did have the ball in the net. Slovenia failed to clear their lines and Josh Cullen was able to find Shodipo in the six-yard area, but the referee penalised the QPR winger for handball after he placed the ball home.
Three minutes from the end, Charsley finally got the goal his play deserved when the industrious Jack Byrne crossed for Cullen to head back for Charsley who swept home.
Cork City's Sean Maguire came on with a minute remaining and his impact was immediate. Collecting the ball 50 yards out, Maguire ran at Denis Sme who slid in to take him down and the referee awarded a penalty. Sme was sent off for a second bookable offence and Maguire cooly placed his penalty home.
Ireland remain 4th in the group but still have a chance of finishing second in the group with a difficult trip to Serbia on Tuesday.
Republic of Ireland: Rogers (GK), O'Connell, O'Connor, Hoban (C), Browne (Dimaio 90), Rea, Cullen, Duffus (Maguire 89), Byrne, Charsley, Shodipo.
Subs: Bossin (GK), Hoare, Dimaio, Connolly, Toner, Mulraney.
Slovenia: Sorcan (GK), Krefl, Bajric, Krajnc (C), Pihler, Hotic (Ozbolt 71), Bajde (Gorenc Stankovic 82), Crnigoj, Sme, Stulac (Balkovec 6), Kavcic.
Subs: Zabret (GK), Ejup, Gorenc Stankovic, Kastrevec, Zahovic.
Referee: Thorvaldur Arnason (ISL)
Yellow Card(s): Duffus. Krefl, Sme.
Red Card(s): Sme