After a poor first half hour played in blustery conditions, the Homecoming Scottish Cup fourth-round tie came to life either side of the break.
The hosts took the lead in the 37th minute when Scott Arfield converted a penalty but Barry Wilson equalised three minutes later.
Bob Harris then gave the Doonhamers the lead after the break before Arfield levelled in the 49th minute.
Barrett killed off Queens' hope of reaching the final for the second successive season with two clinical finishes.
Strong wind and driving rain ensured conditions were far from ideal at kick-off but Falkirk settled well and created two chances within five minutes.
The first arrived after Michael Higdon flicked on Jackie McNamara's long ball and Barrett's tame shot was easily held by Lee Robinson.
McNamara then found Republic of Ireland international Barrett unmarked at the back post but his header was tipped over by Robinson.
After a steady start, on-loan Rangers goalkeeper Robinson dropped McNamara's deep cross but Queens team-mate Wilson was on hand to clear the danger.
The sheer strength of the wind became evident when Robinson's free-kick from inside his own half was held up in mid-air and drifted back in his direction.
The home supporters began to grow restless at seeing their side run out of options in attack with the Doonhamers disciplined in defence.
It was becoming one-way traffic at the Falkirk Stadium as the visitors, fighting against the wind, seemed content to clear their lines at any opportunity instead of finding a team-mate.
Just as it looked like the tie would be goalless at the interval, Queen of the South defender Craig Barr needlessly tugged on Barrett's jersey inside the box and referee Charlie Richmond pointed to the spot.
There was no need for Barr to touch the striker as the Irishman, in possession of the ball, was running away from goal.
Arfield placed the ball on the spot and calmly sent a low drive into the net past Robinson eight minutes before the break.
The lead lasted just three minutes, however, as Wilson found the net from 25 yards with a deflected shot after neat build up from the First Division side.
The second period started in the same way the first ended with a further two goals within four minutes of the restart.
Queen of the South took the lead in the 48th minute with a superb set-piece from Harris.
A free-kick was awarded against home defender Darren Barr for a foul on Stewart Kean on the edge of the box and Harris rifled a left-footed shot high into the net after the ball was nudged to his left.
With the away supporters still celebrating that strike, Falkirk responded in emphatic fashion to restore parity.
Neil McCann pulled a cross back from the byline and Arfield scored for the second time in the match with a clinical finish from 14 yards.
A well-worked move by the Bairns in the 65th minute ended with Lee Bullen finding Higdon at the back post but the former Crewe player just missed the target with a diving header.
Falkirk completed the comeback in the 69th minute with an easy tap-in for Barrett. Robinson could only palm Darren Barr's cushioned volley into Barrett's path from McCann's cross and the striker found the net from close range.
Higdon should have put the result beyond doubt in the 74th minute after hitting the ball over the bar from inside the six-yard box.
The Englishman's header from McNamara's cross cannoned off the bar and, with Robinson grounded, Higdon slid in to to meet the rebound but somehow missed the target.
That proved to be Higdon's last involvement in the game as Hughes brought on Carl Finnigan.
The Scottish Premier League side made certain of their place in the fifth round nine minutes from time after substitute Mark Stewart wriggled clear in the box and his pass was turned into the net by Barrett with the Queens defence missing.