The reigning champions claimed 10 points from a match they looked likely to win at the halfway stage, but 77 overs were lost on day three and 40.2 more on day four.
Brooks’s burst kept their hopes firmly alive until deep into the fourth afternoon when, faced with a target of 298 in 70 overs, Hampshire slipped to 74 for four, including the loss of James Vince for 16.
Shortly afterwards, bad light forced an early tea with Hampshire at 84 for four in the 32nd over, and no more play was possible.
It means that Yorkshire close the gap on leaders Middlesex by a point to just four with three matches to play as their match against Warwickshire at Edgbaston also finished in a draw.
As for second-bottom Hampshire, they claimed nine points and are now 14 points behind Durham with two to play. Durham have a game in hand.
Yorkshire scored 95 runs in 22 overs before declaring 25 minutes before the scheduled lunch break, which was taken early due to rain.
They advanced their second innings from 143 for two from 42 overs overnight to 235 for five declared from 64.
England Test batsman Gary Ballance was one of the three Yorkshire wickets to fall for a 106-ball 72 including 13 boundaries.
Captain Andrew Gale was caught behind for 19 off Brad Wheal’s second ball of the day in the second over without addition to his overnight score.
Ballance reached 50 off 86 balls during an eventful 10-ball spell which saw him hit four boundaries and be dropped on 57 at slip off seamer Gareth Berg.
But Berg at least got his revenge shortly afterwards when he forced the left-hander to chop on, leaving the score at 189 for four in the 53rd over, a lead of 248.
It was the Berg’s seventh wicket in the match and the 200th of his first-class career.
That proved to be the first of two 46-run partnerships Australian overseas batsman Jake Lehmann was involved for the fourth and fifth wickets in during the pursuit of quick runs ahead of a declaration.
Lehmann finished on 35 not out, with Tim Bresnan the third man of the day to fall when he was caught at mid-off for 27 attempting to pull Andy Carter.
There was just one more over before Gale called time on the innings.
Hampshire’s chase started after lunch, and despite losing Will Smith lbw to Ryan Sidebottom as he played to leg in the third over, leaving the score at eight for one, the hosts batted steadily to blunt the visiting charge.
Tom Alsop and Jimmy Adams shared 42 for the second wicket before Brooks, who took five wickets in the first innings, raised visiting hopes.
He had Alsop caught at short-leg, Adams caught at second slip for 30 and then England Test batsman Vince caught at first slip.
Yorkshire captain Andrew Gale said: “That was about as frustrating as yesterday given the position we were in. I was speaking to the lads at the end, and I thought we played some really good cricket in the game, drove the game really.
“It was disappointing to lose yesterday and a lot of overs today. At four down, I’d have backed us to win that game with another 40 or 50 overs of play.
“The title race is wide open. There’s going to be four points in it now, I would have thought. We’ve got two home games, and we have a fantastic home records. We must have one of the best home records in the country over the last few years.
“If we win our next two home games, we’ll be right up there.”