Maghera looked in control after Shane McGuigan's superb 37th-minute goal put them 2-5 to 0-7 ahead.
But Glass' 45th-minute red card for an off-the-ball incident turned the game.
The sides were level with two minutes left but two David Clifford goals sealed Brendan's third Hogan title.
St Brendan's keeper David Carolan had saved an early Francis Kearney penalty but Patrick Kearney netted for Maghera two minutes later after brilliant passes from Glass and Conal Darragh.
The early goal helped Maghera to a 1-2 to 0-1 advantage but Brendan's hit back with five straight points to lead by the 23rd minute.
However, Maghera had a strong finish to the first half as two Shane McGuigan points helped them lead 1-5 to 0-7.
McGuigan showed his array of skills to even greater effect seven minutes into the second half as he blasted to the net from 15 yards after producing a magnificent turn.
At that stage, Maghera, four points up, looked the likely winners as Brendan's had failed to convert a number of scoring chances following the restart.
But Glass' dismissal was a hammer blow to the south Derry school.
Referee David Gough took the decision after consulting with one of his umpires although it wasn't clear what the Aussie Rules-bound star's offence had been.
As 14-man Maghera immediately began to labour, three points from the outstanding Clifford helped St Brendan's level by the 55th minute before before they edged ahead a minute later.
By that stage, St Brendan's had also been reduced to 14 players after the dismissal of Dan O'Brien.
Jack Doherty brought Maghera level in the 57th minute but after another of their attacks was broken up, St Brendan's charged downfield to net as Clifford dived to palm to the net.
With Maghera reeling, Clifford helped himself to another goal in injury-time as he blasted in an unstoppable shot.
St Pat's Maghera's Hogan Cup final hopes were dashed as St Brendan's Killarney fought back to win 2-13 to 2-6 after the controversial dismissal of the Derry team's star man Conor Glass.