Millwall could have added a fourth late in the game when Jack Smith sent a low ball across the penalty area, which John Marquis only just failed to get contact on.
Alexander, who replaced regular first-choice goalkeeper Allan McGregor as per the previous rounds of the competition, wanted too much time with a backpass and was almost caught by Jack Ross but theball rebounded out for a goal-kick.
Craig Dargo volleyed over the bar after Diamond had failed to deal with Jack Ross's searching ball into the area as the Buddies enjoyed a rare period of sustained pressure.