Sussex skipper Ben Brown made an unbeaten half-century to steer his side to a thrilling three-wicket victory over Middlesex for their first win of the season in the Specsavers County Championship.

Four fluctuating days in which neither side held the ascendancy for too long ended with Ollie Robinson hitting James Harris to the long leg boundary to seal the win, before he was embraced by his delighted captain.

Middlesex had taken four wickets for 15 runs before lunch to reduce Sussex to 128-6, but Brown and Michael Burgess put together a match-winning stand of 87, and although Burgess was dismissed for 22 the target was down to 15 runs and Sussex were on course for their first win under new head coach Jason Gillespie.

They had resumed on 35-2 in pursuit of a target of 230 and for the first hour on the final day Stiaan van Zyl and night-watchman Danny Briggs made comfortable progress, extending their third-wicket stand to 89 with Briggs looking comfortable against seam and spin, hitting Harris for three fours in an over.

But on 39 he drove Ollie Rayner to short extra-cover and Middlesex sensed an opening.

It was the first of four wickets in nine overs with Australian Hilton Cartwright picking up two from successive balls.

Frustration got the better of van Zyl on 45 when he edged a delivery angled across him to slip and Cartwright took a low catch in his follow-through from Luke Wright’s checked drive off the next delivery.

Middlesex were favourites again when Harris came back for the last over before lunch and Harry Finch, who made a century in the first innings, played a poor shot outside off stump and was caught behind to leave his side still 102 runs away from victory.

But Brown found a staunch ally in Burgess after the interval and although Middlesex captain Dawid Malan rang the changes in an effort to get a break through – bringing himself on at one stage – the Sussex pair dug in and chipped away at the target.

Burgess offered a chance on 13 when Sam Robson at slip got a hand on a flying thick edge but couldn’t cling on.

The seventh wicket pair added 87 in 25 overs when Malan pinned Burgess in front for 22 but Brown clipped the first ball of the next over from Harris to the fine leg boundary to get the target down to single figures and was unbeaten on 65 from 92 balls with seven fours when Robinson pulled Harris for the winning runs.