"Today is a special day," Castellano told broadcaster NBC just after the race. "I'm so happy, really happy."
Cloud Computing, a 13-1 betting choice, crossed the finish line just a head in front of Classic Empire, the second-place horse. The winning time was 1:55.98.
Always Dreaming, which led much of the race, finished well back after fading down the stretch at Pimlico Race Course near Baltimore. He was eighth, almost 14 lengths behind the winner.
Cloud Computing is the fourth horse in 34 years to win the Preakness after not running in the Kentucky Derby.
"I'm not going to dispute the fact that we brought in a fresh horse -- that was part of our strategy," trainer Chad Brown said.
It was the first victory in a Triple Crown race for Brown.
"It's a dream come true. It's a culmination of a lot of hard work," he said.
Always Dreaming and Classic Empire broke well from the gate and galloped to the lead with Always Dreaming along the rail and Classic Empire on his shoulder. Many of the record crowd of 140,327 were sure it was a two-horse race as the field went down the backstretch.
The focus grew on Classic Empire, which finished fourth at the Kentucky Derby, as the colt raced past Always Dreaming in the final turn and took a significant lead.
Cloud Computing sat third at each quarter pole, waiting for the home stretch to make a move.
The Klaravich Stables entry, having not raced in six weeks, had enough to run down Classic Empire and edge him at the line.
The final leg of the Triple Crown is the Belmont Stakes on June 10 in Elmont, New York. Brown indicated that it has not been determined whether Cloud Computing will race.
"It's possible," he said.