Sometimes life imitates art. That’s what Dylan McDermott found out when he joined the cast of the CBS crime drama “FBI: Most Wanted.” His first episode with the Dick Wolf Tuesday night series can be seen at 10 p.m. April 12.

McDermott plays Remy Scott, an FBI agent who joins a veteran team on the Task Force who have been working together for years. That is exactly what McDermott faced when he became the new member of the acting ensemble in its third season.

Just like his character, McDermott’s introduction to the cast was on the first day of filming.

“Remy was introduced to them and Dylan was introduced to them at the same time,” McDermott says. “They had asked me, ‘Oh, do you want to meet the actors, and would you like to sit down with them and talk to them?’ I said “No. I want it to be as if it’s Remy’s first day and Dylan’s first day coincides.’

“So, that was great because they were checking me out. I was checking them out. It was a little bit awkward. Not sure. New guy stuff. So, it actually worked out beautifully.”

McDermott got to be the new guy on “FBI: Most Wanted” when Julian McMahon decided to leave the series to pursue other acting opportunities after three seasons. There will be no chance his character of Jess LaCroix will be coming back for a visit as he died on the job.

That opened the door for McDermott to be part of the CBS Tuesday night lineup that also includes “FBI” and “FBI: International.” “FBI: Most Wanted” focuses on the Fugitive Task Force, which relentlessly tracks and captures the notorious criminals on the Bureau’s Most Wanted list. 

Scott, who started his career in the New York FBI field office before rising through the ranks of the Bureau in Philadelphia and Las Vegas, will be in charge of a team that includes: Special Agent Sheryll Barnes (Roxy Sternberg), a former NYPD detective and forensics expert; Special Agent Hana Gibson (Keisha Castle-Hughes), a millennial computer; Special Agent Ivan Ortiz (Miguel Gomez), who has a gift for undercover work; and Special Agent Kristin Gaines (Alexa Davalos), a Navy veteran.

Landing the role as the head of the FBI team is a big acting switch for McDermott. He most recently played a character entrenched on the wrong side of the law in the second season of “Law & Order: Organized Crime.”

McDermott knows there are some who think it is too soon after playing a notoriously bad guy to take on such a good character. He’s happy when he hears those kinds of comments.

“I relish in it because I think it’s amazing that people actually believe that’s the character that I play, I’m him. And, so they haven’t even seen the episodes, by the way,” McDermott says. “So I just love that because now they’re going to see me in a completely different light from Richard Wheatley to Remy Scott.

“These are wildly different people and wildly different agendas in life. And I knew instinctively that I had been playing some questionable people along the way, and now it was time to play someone good again. And Remy Scott is that character. You’re going to see so many different facets of this guy that I think you’re going to quickly forget about Richard Wheatley by the end of episode 17. I think you’re going to be like, ‘This is Remy Scott.’”

The fact McDermott is going from one show produced by Dick Wolf to another made the transition very easy. He developed a shorthand while working on “Organized Crime” that helped him quickly understand the character.

His understanding worked so well, he was originally only hired for only eight episodes but was quickly contracted to be in an additional eight.

“And then, when ‘Most Wanted’ came around, I thought, ‘Wow. What a great opportunity to go from one Wolf show to the next’ and sort of create an entirely different character,” McDermott says. “I had never seen it done before, frankly, and I thought that’s cool. Let’s play with that.

“That’s exciting to me as an actor to be able to go from a wildly bad guy into a character who is so noble, and I just thought that was a great exercise for me as an actor.”

Over the years, McDermott has played both good and bad characters. His breakthrough role came in the 1983 film “In the Line of Fire.” Since then, his film credits include “Miracle on 34th Street,” “Steel Magnolias,” “Olympus Has Fallen” and “The Campaign.”

His TV work includes “American Horror Story” and “The Politician” but he’s best known for the eight seasons he portrayed senior defense attorney Bobby Donnell on the ABC legal drama “The Practice.” That role earned him a Golden Globe for Best Performance by an Actor in a Television Series and an Emmy nomination.

New episodes of ‘FBI: Most Wanted” can be seen on CBS and the streaming service of Paramount+.