The Irn-Bru Second Division side had held Saints to a 2-2 draw in the first game at Glebe Park but Samuel's angled drive after 37 minutes effectively ended hopes of a replay shock.
The visitors rarely threatened in what was a rather tepid cup tie and only careless finishing prevented the margin of victory being larger for the Perth men.
St Johnstone will now contest their fifth semi-final in four years and will take on either Motherwell or Dundee United at Hampden Park on April 16 for the right to face Celtic or Aberdeen in the final.
It was not the most convincing of performances but there is no doubt Saints deserved their win and they dominated the early stages.
In the fifth minute left-back Danny Grainger's long ball was headed down by Peter MacDonald to Samuel who volleyed wide of the target from the edge of the box.
Then Saints midfielder Murray Davidson, who will join up with the Scotland squad in Spain on Wednesday ahead of Sunday's friendly with Brazil in London, crossed from the right but Liam Craig was stretching and could only knock over the bar.
He then turned provider in the 16th minute and when his cross was cleared to the edge of the box Danny Invincibile returned a shot which Brechin keeper Craig Nelson pushed behind for a corner.
From the corner, the former Kilmarnock player had another effort from close range blocked in a busy six yard box.
The visitors survived that spell of pressure and broke moments later to almost take advantage of a mistake by McDiarmid Park defender Steven Anderson but McAllister drove high over the bar.
Brechin looked as if they were beginning to settle down a little but still the SPL outfit looked more likely to break the deadlock.
In the 27th minute Invincibile had another chance when Chris Millar's cross found him at the back post but this time his low volley missed the target by a yard.
But in the 31st minute Brechin came close to grabbing a shock lead when keeper Peter Enckelman had to throw himself full length to prevent Gary Fusco's powerful drive from 16 yards zipping in at the far post.
However, in the 37th minute Saints got their noses in front through Samuel.
Davidson lobbed the ball in to the former Falkirk and Dundee United striker from the edge of the box and although his first attempt was blocked by Gerry McLauchlan, he held off the Brechin defender before rifling past Nelson from a tight angle.
Just before the break Samuel clashed with McLauchlan in the Brechin box but referee Steve Conroy ignored Saints' claims for a penalty.
The visitors came back out with a more positive approach but within four minutes of the restart MacDonald climbed high at the back post to head a Grainger corner over the bar.
The cup tie was warming up a little bit more and minutes later, after combining with Samuel at the edge of the Brechin penalty area, MacDonald sent a left-footed drive past the far post.
Brechin began to tire as the match entered its final stages and in the 71st minute Invincibile ended an intense passage of pressure by driving high over the bar.
MacDonald picked up a booking for a foul on McLauchlan before Craig headed straight at Nelson as Saints invaded the Brechin box again.
MacDonald should have clinched victory in the 85th minute when he only had Nelson to beat from 12 yards but he blasted over the bar to the groans of the increasingly nervy home support who were happy to hear the final whistle as Brechin rallied at the end.