The NASCAR Winston Cup regular from Bakersfield defeated Bobby Labonte in a last-lap battle at California Speedway. Harvick beat Labonte by .149 seconds and won with an average speed of 161.580 miles per hour.
Pole-sitter Dale Jarrett was third, followed by Winston Cup points leader Sterling Marlin and Jack Sprague. Winston Cup drivers swept the top four positions; Sprague is a regular in the NASCAR Busch Grand National series.
Harvick went from third to first at the start of the race when he passed Castroneves and Jarrett.
"We needed to be out front and try to be halfway in control of our own destiny," Harvick said. "It's a little bit hard to pass when you get underneath somebody to carry your momentum, so it worked out pretty good."
Harvick was suspended for the Winston Cup race at Martinsville, Va. earlier this month for incidents in a Busch and Truck series races at Bristol, Tenn. and Martinsville.
"I don't feel like I have anything to prove," Harvick said. "To win an IROC race puts you in different company because you get to race against the top drivers from other series, like the Indy Racing League. I always watched IROC when I was a kid and now it's great to have won an IROC race.
"I'm aggressive, no matter what series I'm racing in. That's the way I was taught to race -- to lead laps and race hard. We were pretty fortunate the opportunity arrived, and we took it."
Harvick became the first IROC rookie to win a race since Jeff Burton in 1998 at Michigan.
Labonte made a bid on the last lap to pass Harvick on the backstretch but was unable to get by the leader.
"I did not want to make a move too early on Harvick," Labonte said. "I thought I would wait until the last minute, at least. I thought if he bogged down a little, I would have a shot at winning. I'm just glad I finished second. You just do the best you can any race."
Harvick's victory may help ease some of the scrutiny the driver has been under since his suspension.
"He's a good race driver with a lot of talent," Jarrett said. "When he looks back at this, 15 years from now, he'll probably think that was a good thing that happened to him at this point in his career."
Harvick said he will try to be a little more judicious in the future.
"I'm an aggressive person, a very outspoken person," he added. "I have to know when to do that at the right time. It's not bad to learn that lesson."
Stewart leads the IROC series with 35 ponts, three more than Harvick. Labonte is third with 30, followed by Unser and Sprague with 22 apiece.