Tony Mowbray's men had tumbled from the automatic promotion spots to mid-table with a haul of just eight points from 51 in 2013 and Carayol's consummate finish before the break sealed a first win in eight games for the Teessiders.
It was enough to keep Boro within six points of Leicester in the last play-off spot, though, with Forest remaining a point shy of sixth with three games still to play.
Jason Steele repelled a close-range Simon Cox header before Scott McDonald saw his left-footed drive palmed clear at full-stretch by Karl Darlow at the other end.
Billy Sharp headed past the post from a short Cox cross before Greg Halford nodded over the crossbar as the ball bounced around the Boro box.
There were three minutes to play before the break when Boro broke the deadlock against the run of play. As Josh McEachran threaded a cute pass from deep and through the Forest back-line, Carayol dropped his shoulder to cut in from the left and take one touch before drilling hard and low beyond Darlow.
The Forest fans fell silent but their side were spared as Darlow pounced on Carayol's drive to the near post in time added on.
Kieron Dyer tried his luck with several balls in to the lurking McDonald, with Halford wise to every cross, but the Forest defender was nowhere to be seen when Richard Smallwood broke through in the 77th minute.
The Academy graduate found an unmarked Faris Haroun to his right but the Belgian substitute somehow clipped over an open goalmouth.
Boro would so very nearly live to regret that spurned opportunity when Chris Cohen came knocking two minutes from time. The Forest captain seized on an untamed knockdown on the left edge of the six-yard box but slammed his shot across Steele's goal and wide.