The capital club edged out St Mirren to reach the quarter-finals of the Scottish Gas Scottish Cup on Monday.