PHOENIX — Ex-Yankee John Ryan Murphy has somehow found a way to be smack in the middle of some amazing Yankees history. If it’s not Mariano Rivera, it’s CC Sabathia.

Tuesday night at Chase Field, the Diamondbacks backup catcher became Sabathia’s 3,000th strikeout victim. It happened in the second inning, when Sabathia struck out the side and also gave up a solo home run to ex-Met Wilmer Flores.

Flores knocked in a second run in the fourth as the Diamondbacks went on to a 3-1 victory.

Murphy swung through a diving 84-mph changeup as the left-hander reached the milestone only 17 major league pitchers have reached.

Murphy, then a rookie, also was in the middle of Rivera’s last game, Sept. 26, 2013, at Yankee Stadium, catching the Hall of Famer. He was on the mound when Derek Jeter and Andy Pettitte came from the dugout to take Rivera out of the game, an incredibly emotional moment in Yankees history.

Rivera goes into the Hall this summer. Sabathia will join him someday.

Murphy, who was behind the plate for Sabathia’s 2,500th strikeout in 2015, had a sense of humor about Tuesday night’s strikeout. Sabathia was the leadoff hitter in the third and as he came to the plate.

“I asked him if he wanted me to sign the baseball for him,” Murphy said.

“CC and Mo are the same kind of guys,’’ Murphy later told The Post. “CC was really the first guy for me who took you under the wing. A lot of veteran guys over there did that, but he was just more interactive with getting all the young guys to dinner, hanging out in the hotel room on the road.

“CC was the first guy for me to welcome me to the big leagues in that sense and I’ll always be thankful for that and my time over there. CC made a big impact on me.’’

In that final Rivera game, Murphy, with two outs in the ninth inning, stood off to the side of the mound, with his catcher’s helmet propped up on his head, pretty much an accidental participant to Yankee history.

“I have a picture when he got taken out with Andy and Jeter there and all three of them, and I’m sitting there with my mouth open,’’ Murphy told The Post.

“Mo is incredible. What else can you say, that was pretty special and is something I will always have in the memory bank. Tonight was the same but in a little different sense.

“The 3,000 strikeouts speak to the pitcher CC is. Steve Carlton and Randy Johnson were the only other lefties to do it, that speaks for itself. To do what he has done after not having the kind of velocity he once had and the knee injuries he had, it speaks to the competitor CC is. That’s a lot of strikeouts.’’