On his first appearance of the 2016 domestic season, Hales batted two and half hours for 34, to add to his first-innings 36, before being bowled by a Jack Brooks delivery that kept low.
David Willey took his first wicket for Yorkshire but Samit Patel (51 not out) guided Notts to 151-5, a lead of 122.
Liam Plunkett's 51 earlier helped the visitors recover from 173-5 to 290.
The defending champions had looked well set resuming on 170-4 at Trent Bridge, but their progress was soon checked with the early loss of Alex Lees (92) to Harry Gurney.
Jake Ball finished with figures of 4-57 as Nottinghamshire limited the Tykes to a slender advantage of 29, with Plunkett the only other player to pass fifty.
England all-rounder Willey, wicketless on day one of his debut, then trapped Steve Mullaney lbw just four balls into the hosts' second innings.
Hales looked far from his fluent best as he dug in for an obdurate 115-ball knock, which featured five fours, before Patel's well-paced half-century helped Nottinghamshire close 122 runs in front heading in to the final day.
England opener Alex Hales again missed out on a half century as Yorkshire edged the day against Nottinghamshire.