The visitors fell to 14-4 as Mitchell Claydon (3-73) and Darren Stevens (3-60) each struck twice to dismiss the top four batsmen for only nine runs.
However, Marshall and George Hankins (45) helped Gloucestershire rebuild before Calum Haggett bowled Hankins.
The away side closed on 296-9, with Marshall caught off Claydon for 112.
Jack Taylor's impressive start to the year with the bat continued as he made 52 in a century seventh-wicket stand with Marshall, before the pair were dismissed in consecutive overs in the final session of play.
Hamish Marshall's century helped Gloucestershire recover after a disastrous top-order collapse on day one against Kent at Canterbury.