Five-wicket haul sets up the prospect of a dominant position, as openers reach close unscathed