Fifth-wicket stand of 154 in 77 overs follows 45 for 4 on third evening after Yorkshire set 520 target