Sussex 208 for 4 (Wells 75, Nash 66) trail Gloucestershire 229 (Dent 90, Payne 56, Magoffin 3-36) by 21 runs
The pair put on 114 for the second wicket to leave the visiting county on course for a significant first-innings lead. By the close, Sussex were 208 for 4, just 21 runs behind Gloucestershire.
Having resumed on their overnight total of 201 for 7, the host county lost their last three first-innings wickets for just 27.
Chris Dent, who not only had a century in his sights, but the accolade of being the first Gloucestershire batsman in 11 years to carry his bat in a four-day game, was first to go, caught and bowled by Jofra Archer.
The 25-year-old left-hander, who had been the mainstay of the Gloucestershire innings on day one, finished 10 runs short of three figures. He helped himself to 90, off 193 balls with 11 fours.
David Payne, who played his part in the pair's 114 run partnership for the eighth wicket, saw Josh Shaw depart shortly after - bowled by Archer for 1.
Then, Payne, whose fifty came off 105 balls with nine boundaries, eventually perished for 56, caught and bowled by England seamer Chris Jordan. Archer finished with the impressive figures of 3 for 39 off 14 overs. Steve Magoffin also picked up three wickets, with Jordan and Ollie Robinson bagging two apiece.
Early-afternoon rain and bad light saw the sides taken off twice by umpires Martin Saggers and Paul Baldwin, before the skies cleared and Nash and Wells settled in on a wicket that was still providing the seam bowlers with plenty of help.
It was tough going for both players with Matt Taylor, in particular, causing problems outside the off stump.
Still, much as Dent had done on day one, the pair stuck to their task and ground it out until Nash departed, for 66, in the 37th over, caught behind by Phil Mustard off the bowling of Josh Shaw.
Shortly before tea, Flynn Hudson-Prentice was bowled by Shaw to leave Sussex on 128 for 3 at the interval.
Wells continued to prosper in the final session and after passing his half century he added 58 for the fourth wicket with Phil Salt before he became Shaw's fourth victim of the innings, for 75, off 151 balls with 13 fours.
Shaw finished the day with figures of 4 for 45 off 15 overs with Salt, at the close unbeaten on 29 and Ben Brown 13 not out.