Yorkshire 350 (Ballance 109, Brook 79, Steyn 5-56) and 91 for 2 trail Hampshire 443 ((Adams 147, Berg 84*, Alsop 63, Brooks 5-124) by two runs
Ollie Rayner grabbed his first two Hampshire wickets but Yorkshire kept the game in the balance by taking a slender two-run deficit into the final day.
Offspinner Rayner only joined Hampshire on loan at the beginning of the week, having been dropped from Middlesex's squad to face Leicestershire, to cover injuries for Mason Crane and Brad Taylor, along with England Lions' Liam Dawson.
And while Dawson performed an impressive four wicket haul on international duty, Rayner deputised with skill during a six over spell of 2 for 4.
Yorkshire had been given the entire 35 overs of the night session to eat away at Hampshire's 93-run first innings lead, after Gareth Berg's fifty with the tail, and start to rebuild an advantage of their own.
Alex Lees, having only scored 10 runs in his previous five Specsavers County Championship innings this season, started off with vigour, taking Fidel Edwards for four boundaries in his first over.
Opening partner Adam Lyth was more circumspect with his 17 but became Rayner's first Hampshire wicket as he tentatively left his bat outside off stump to edge to keeper Tom Alsop.
Exactly two overs later, Rayner was celebrating again when he had Lees lbw to a straight delivery, for a confidence building 39.
Yorkshire ended the day with key batsmen Gary Ballance, who scored a century in the first innings, and Indian's Test star Cheteshwar Pujara unbeaten on 18 and 14.
Earlier, Jimmy Adams and Tom Alsop started the day looking to build on their 132 and 62 not outs - but the latter could only add a single before departing in the second over of the day.
The left hander was plumb lbw to Brooks - ending a slow paced 179-run stand, from a mammoth 67.2 overs.
The run scoring remained hard going throughout the morning session, with accurate bowling with a difficult to get away soft pink ball offering nothing to either side.
Adams in particular struggled to get going again on the third day, only managing 15 runs in 85 minutes before he was undone by extra bounce from Tim Bresnan and was caught behind for a season high 147.
Hampshire tiptoed to 300 as they managed to reach a third batting point with seven balls of the spare before Brooks had Ian Holland, after a patient 31 caught, and Steven Patterson dismissed Ollie Rayner for a duck both caught behind.
Just as Yorkshire sniffed a first innings lead, Kyle Abbott and Berg added 74 in a frustrating eighth wicket stand - with the all-rounders accelerating the run-rate.
Berg was left stranded unbeaten on 84, with Hampshire bowled out for 443 and boasting a strong lead of 93.