The catcher, acquired from Seattle in the Mark Trumbo trade this week, hit a two-run homer with two outs in the seventh inning to lift Arizona over Bartolo Colon and the New York Mets 2-1 on Saturday night.
Castillo, playing for his third team this year, struck out four times in his Arizona debut Friday night but lined Colon's first pitch just over the left-field wall.
"Really, really nice," he said, "especially to get a win. I wasn't playing very much for the other team that I was on. I'm going to get time to play here."
Colon (8-4), trying to become the NL's first nine-game winner, had blanked Arizona on three hits through six innings.
"I made a mistake," he said through a translator. "Bad pitch, bad location. If you make those mistakes in the big leagues you are going to pay for it. The pitch was running to his wheelhouse and he was able to hit it out of the park."
Randall Delgado (3-2) pitched a scoreless seventh to get the win. Brad Ziegler escaped a ninth-inning jam for his sixth save when pinch-hitter John Mayberry Jr. bounced into a game-ending double play with two on.
It was the fourth double play turned by the Diamondbacks.
The 42-year-old Colon allowed two runs and five hits in seven innings, striking out seven and walking one. He fell to 2/3 in his last five starts.
Arizona's Chip Hale was ejected for the first time as a big league manager, by plate umpire Mark Ripperberger for comments Hale yelled from the dugout after Paul Goldschmidt was called out on strikes to end the sixth.
"Once you show your displeasure they'll let you say a few words, but I started motioning and he'd had enough," Hale said. "I just went out and told him, `Hey, when Goldy argues I know it's not the right call because he really knows the strike zone."
Goldschmidt, who had taken off his helmet and tossed his bat for what he thought was a walk, confronted Ripperberger briefly. Hale said it was only the second time he'd seen Goldschmidt argue like that.
For the second night in a row, the Mets took the early lead with a solo shot, Lagares' second homer of the season. It was only the third home run off Anderson this season and first since April 27.
In the sixth inning, New York had a chance to pad its lead.
"It has been happening a lot," manager Terry Collins said of the Mets' inability to get timely hits. "You've just got to work through it. You can't let it get to you. You can't get too frustrated. You've just got to continue to press forward."
After the game, the Diamondbacks optioned right-hander Dominic Leone to Double-A Mobile to make room for right-hander David Hernandez, who is coming off Tommy John surgery and will be activated on Sunday.
In the fifth inning, the bat slipped out of Campbell's hands and hit Ripperberger in the side of the head. Castillo grabbed Ripperberger to steady him and, after a visit from the Diamondbacks' trainer and a meeting with the other umpires, Ripperberger stayed in the game.
Mets: Collins said shortstop Wilmer Flores was out of the lineup due to general body stiffness.
Diamondbacks: 3B Jake Lamb, out since April 19 with a left foot stress reaction, was activated from the DL. C Jordan Pacheco was designated for assignment. Lamb entered the game as a defensive replacement in the eighth and turned the game-ending double play.
Mets: RHP Jacob deGrom (6-4, 2.41 ERA) pitches the finale of a seven-game road trip Sunday. The NL Rookie of the Year is 3-0 with a 0.92 ERA in his last three starts, with 34 strikeouts and one walk. He has not allowed an extra-base hit in the last 33 1/3 innings.
Diamondbacks: RHP Josh Collmenter (3-5, 5.03) goes for Arizona. He has held opponents to three runs or fewer in his past three starts.
A's hold off Abreu, White Sox 5-3, force series to Game 3
Marcus Semien and Khris Davis homered early and the Oakland Athletics held off Jose Abreu and the Chicago White Sox in the late innings for a 5-3 win Wednesday that sent their AL playoff series to a deciding Game 3.
Carlos Correa throws down gauntlet on Houston Astros haters
Carlos Correa played the hero role in helping Houston advance then didn't pull punches toward the wider world's feelings on the Astros. "I know a lot of people are mad ..." Correa said. "But what are they going to say now?"
MLB allowing limited number of fans for NLCS, World Series in Arlington, Texas
sports/topics/newsA limited number of fans will be allowed to attend the National League Championship Series and World Series next month in Arlington, Texas, Major League Baseball announced Wednesday.
Sources: Miami Marlins outfielder Starling Marte suffers broken left hand
Marlins outfielder Starling Marte suffered a broken left hand when he was hit by a pitch in the ninth innning of Wednesday's wild-card win vs. the Chicago Cubs.
Houston Astros fans get to laugh at the haters for at least one day in MLB playoffs
Against baseball, karma sometimes doesn't stand a chance. The Astros, caught cheating in the offseason, swept the Twins on Wednesday. Their fans, and a few haters, had a lot to say about it.
Dickerson homers as Marlins beat Cubs 5-1 in playoff opener
Corey Dickerson hit a three-run homer off a fading Kyle Hendricks in the seventh inning, and the Miami Marlins beat the Chicago Cubs 5-1 on Wednesday in Game 1 of their NL wild-card series.