Two judges gave all five rounds to Cormier and the other one gave him four.
"This means the world to me," Cormier said. "I want to focus on the fact that I just beat Josh Barnett. This is something that I thought a year ago I could never do."
Twice Olympic wrestler Cormier used his speed to get to Barnett, who has a greater range, and took him down in each of the last four rounds.
"He basically controlled the pace of the fight," said Cormier's lead trainer Bob Cook. "He was able to control the stand-up.
"Daniel's deceptively fast for a heavyweight. He's got really quick reaction, so it allows him to do a lot of things that might not otherwise work or happen, because he's able to get in and out so quick and duck and counter."
Cormier added: "I was very surprised at how easy it was to stay in his guard. I made an adjustment in the fight when I realised he was going to allow me to control him on the bottom."
Barnett was magnanimous in defeat.
"Today Daniel was better," he said. "He's a great athlete and I always knew he was going to be a hell of an opponent."
Strikeforce lightweight champion Gilbert Melendez retained his title with a split decision over former champ Josh Thomson in their third meeting.
All three scorecards were 48-47, with two judges giving it to Melendez. The fans booed the decision as San Jose is Thomson's home town.
Melendez lost their first fight in 2008 then won a spectacular rematch the following year.
Rafael 'Feijao' Cavalcante needed just 33 seconds to submit fellow light-heavyweight Mike Kyle while Chris Spang beat Nah-Shon Burrell at welterweight with a first-round TKO.