Carayol blasted the visitors ahead in the 23rd minute, bursting through the middle and smashing past Stuart Nelson in the Gills goal.
And Scotland Under-21 international Park secured victory in the final minute, chipping over Stuart Nelson following Danny Kedwell's poor pass.
Swansea target Marvin Emnes almost had Middlesbrough ahead in the opening five minutes when he beat the offside trap only for goalkeeper Nelson to deny him.
Kedwell fired wide but Boro went straight down the other end and Carayol bundled his way through before beating Nelson for the opener.
The Gambian winger almost doubled his tally straight after the break only to see his effort deflect off Callum Davies and onto the post.
Gillingham should have equalised when Deon Burton headed on for Kedwell but the striker fired just wide, before Boro saw highly-rated defender Rhys Williams stretchered off after twisting his ankle.
The hosts dominated the closing stages but when Kedwell lost the ball in midfield Park broke clear and chipped Nelson to seal the win after 89 minutes.