Mark Prenter opened the scoring for the hosts at the Dub with a curling 25-yard free kick, before Colin Nixon pulled one back for the Seasiders with a close-range finish five minutes later.
Another stunning set piece from Prenter restored the Championship Two side's advantage in the 58th minute, and James Ferrin converted from the spot to make it 3-1 with six minutes to go.
Bangor suffered a further blow when they lost Andy Hall to a red card and although Jordan Forsythe added a late penalty, Queen's held on for a memorable victory.
In the game at the Ballymena Showgrounds, Ballymena United booked their place in the last four with a 4-1 victory over Dungannon Swifts.
Davy Munster got the Sky Blues off to the perfect start when his second-minute header crept in off the post.
Johnny Taylor later hit the mark, also with a headed effort, in the 22nd minute.
Darren Boyce nodded home Jim Ervine's cross eight minutes later, before Ryan Harpur capitalised on some confusion in the Ballymena box to force the ball home and open Dungannon's account in the 55th minute.
However, the Swifts never looked like clawing back the deficit, and Boyce scooped the ball into the top corner from eight yards and three minutes from time to make sure of their semi-final spot.
Elsewhere, on Saturday Ballyclare Comrades bowed out at the quarter-final stage after they lost 5-0 to Crusaders in their last eight clash at Seaview.
Nathan Hanley opened the scoring with a penalty after Comrades' captain Andrew Doyle was adjudged to have handled in the area.
The afternoon went from bad to worse for the skipper when he was sent off for a second booking eight minutes before the break.
Matthew Snoddy extended the Crues' lead in the 55th minute and Declan Caddell made it 3-0 when he got the decisive touch on a Richard Clarke cross.
With the game effectively over as a contest, David McAllister and Gary McCutcheon set each other up to score goals four and five in the final moments of the game to seal a comprehensive victory and a meeting with either Glentoran or Glenavon in the semis.
At Ferney Park, Glenavon overcame Ballinamallard 3-0 in a rescheduled sixth round encounter, after their original fixture was postponed due to a waterlogged pitch.
Guy Bates was the man who did the damage for the Lurgan Blues, netting the opener with a headed finish from Andy McGrory's pinpoint cross in the 10th minute.
Bates found the target again in the 62nd minute with a wonderful effort from distance, and completed his hat-trick with a 90th minute penalty to ensure his side's progression to the next round.
Glentoran will be the quarter-final opponents for Gary Hamilton's side, after they struck late to deny Armagh City.
After Jay Magee had given the Glens the lead from the penalty spot in the 44th minute, the Championship One side levelled when the lively Stephen Murray fired home after some suspect defending from the hosts.
With the game seemingly heading for extra time David Scullion popped up with the winner in the 90th minute with a close-range finish from William Garrett's cross to break Armagh's hearts and seal Glentoran's progression to the last eight.
Irish Cup results
Ballinamallard United 0 - 3 Glenavon
Glenavon: Guy Bates (10, 62, 90+1)
Irish Cup sixth round replay
Glentoran 2 - 1 Armagh City
Glentoran: Jay Magee (pen 44), David Scullion 90
Armagh: Stephen Murray (80)
Ballymena United 4 - 1 Dungannon Swifts
Ballymena United: David Munster (2), Johnny Taylor (22), Darren Boyce (30, 87)
Dungannon: Ryan Harpur (55)
Crusaders 5 - 0 Ballyclare Comrades
Crusaders: Nathan Hanley (pen15), Matthew Snoddy (55), Declan Caddell (76), David McAllister (87), Gary McCutcheon (90)
Comrades: Andrew Doyle sent off (37)
Queen's University 3 - 1 Bangor
Queen's: Paul Prenter (25, 58), James Ferrin (pen 84)
Bangor: Colin Nixon (29) Andy Hall sent off (87)