The pair batted for eight hours and 135 overs at the Rose Bowl as they compiled Hampshire's highest ever partnership and the ninth highest stand in all first-class cricket.
McKenzie was eventually out for 237 while Carberry, who only returned to the Hampshire team last month after November's diagnosis of blood clots on his lung, went on to score an unbeaten 300.
"This was only my third match back in the team and I cannot believe it has gone so well," said Carberry.
"The pitch was perfect to bat on and Neil and I kept each other going. It has been well documented that I had blood clots on the lung and it has taken nine months out of my life.
"I am lucky just to be playing again so to get 300 exceeded all my expectations."
Carberry faced 427 balls, hitting 25 fours and two sixes during his triple-hundred.