Dunn and Fuller share spoils
Surrey's Matt Dunn returned career-best figures but Gloucestershire struck back to leave the Division Two clash at the Kia Oval finely poised.
Dunn, who celebrated his 22nd birthday on Monday, took five for 48 to eclipse his haul at Derby in 2011, when his side dismissed Derbyshire in the second innings for 99 during a seven-wicket victory.
But any hopes of a similarly comfortable win were soon dispelled, as James Fuller took four wickets to reduce the hosts to 62 for six - with Zafar Ansari having also retired hurt - before Jason Roy and Chris Tremlett steadied things down to reach 118 for no further loss by the close - a deficit of 50.
Dunn made the first breakthrough in the game's third over - Chris Dent rapped on the pads by one that swung late - but was denied a second in the same set of six when William Tavare was dropped second ball by Roy at second slip.
Tavare was put down again when on 30, Ansari the guilty party at square leg, and he made sure the mistakes were punished with his fourth first-class half-century.
He combined with Michael Klinger to bring up a fifty partnership, after the Gloucestershire skipper had taken issue with the red sponsorship boards in the background that were preventing him from picking up Tremlett's deliveries.
Klinger would eventually depart for 24 in the 16th over, edging Tom Curran behind to Gary Wilson, who had taken the gloves to allow Steven Davies to, ultimately unsuccessfully, concentrate on his batting.
There was much amusement when Tavare was denied a four off Dunn's bowling when the ball struck a pigeon in the outfield, stopping the ball reaching the rope.
But aside from endangering London's wildlife, Tavare and Will Gidman appeared comfortable as they brought up their side's hundred.
However, right on the lunch interval, Gidman became Dunn's second lbw victim after making 13.
In the afternoon, Dunn's pace was too much for Hamish Marshall, whose off-stump was dislodged by a superb yorker.
Tavare went to his fifty but he was then involved in three Gloucestershire wickets falling for just four runs.
First Curran snared Benny Howell for three, with a thick edge well taken by Graeme Smith at slip. Tavare went in the next over for 59, with the score still on 130, with Smith again doing the job in the slips after Tim Linley had found the edge.
Ian Saxelby then fell for three, edging an outswinger from Linley behind to Wilson, who took a good catch low to his right.
Cameron Herring and and Fuller (17 not out) put on 25 for the eighth wicket - the third highest partnership of Gloucestershire's innings - before the former became Tremlett's second first-class scalp of the season. Herring's thick edge flew to gully, where Rory Burns took a fantastic diving effort to his left.
Dunn then completed his five-for with the wickets of Graeme McCarter (one) and Matt Taylor (two) as Surrey appeared to have put themselves in a strong position as tea was taken.
But their response faltered as early as the third over, when Fuller removed both Burns and Dominic Sibley.
Gloucestershire suffered a blow when Saxelby - who missed the entire 2013 campaign through shoulder and knee problems - broke down after just two balls of the ninth over - his first - while Surrey also lost a man in the next as Ansari was forced to leave the field with an elbow complaint.
It remains to be seen whether he can return to the field tomorrow.
In the next over, Surrey skipper Smith departed, pinned lbw by Howell.
Davies soon followed, failing to make the most of his chance to concentrate solely on batting as he was caught by Tavare at fourth slip off Taylor without troubling the scorers.
Wilson steadied things somewhat with a 35-minute stay at the crease alongside Roy.
But Fuller again struck twice in an over, first having Wilson caught at mid-wicket and then emphatically uprooting Curran's off stump second ball.
Roy remained unbeaten at the close on 44, though, and was joined in a defiant fifty-stand by Tremlett, who scored 19 from 74 balls.