The Rikers Island inmate stood inches from Dupree McBrayer’s upturned face. He snarled.

“You don’t want to be here,” he told the 9-year-old. “This is a BAD place.”

Seconds later, the prison’s assistant warden came and collected McBrayer and his older brother. They were in her care now.

A glance at wide eyes on the way back to their Queens, N.Y., home told that warden — McBrayer’s mother, Tayra McFarlane — that her point had been made.

“I don’t want that,” McBrayer, now a starting guard with the Gophers, remembers thinking then. “I can’t have that.”

The trip to McFarlane’s workplace of the past 20 years was another effort by the single mom in keeping her three boys off the wrong path that too many youngsters in the boroughs choose. McFarlane wanted to ensure that they channeled their energies elsewhere.

Her strategy? Hoops.

“I had to stay on top of them and their whereabouts and keep them busy,” McFarlane said. “So I got them in basketball, and I just kept them running.”

McBrayer, along with older brothers Malik and Antoine, who now live in Georgia and South Carolina, all started early and played often.

“It kept me out of trouble,” McBrayer said. “It kept me off the streets. It brought me home real early. I knew I had to go to the game the next day so I wouldn’t stay out late.”

In the final stretch of his freshman season at Minnesota, that dedication is beginning to pay off.

McBrayer began the year as a reserve guard who wasn’t afraid to take shots — but rarely made them. In his first 14 games, he went a stunning 3-for-27 (11.1 percent) from three-point range. Coach Richard Pitino took every chance he got to gush about the talent he knew lived within McBrayer, even as he struggled.

At the same time, the Gophers were mired in a historically bad 14-game losing streak. On Saturday, McBrayer admitted the team sank to a “low.”

“It was hard for me at first,” he said. “I wasn’t grasping the speed.”

When he felt the worst, he’d pick up the phone and call his mother.

“Stick with it,” she’d tell him. “I didn’t raise you to be a quitter.”

Pitino has lauded McBrayer’s unwavering drive. At the end of blowouts, McBrayer has often been the one leading the charge. When he’s elbowed or jabbed, he bounces back. He gets that from the assistant warden, who loved as hard as she protected.

“She’s the toughest person,” McBrayer said. “Tough as nails, probably. I think she gave me a little bit of that.”

Battling, in basketball

Growing up, any time McBrayer lost motivation, there would be a story. A reminder, or a tale, told by McFarlane, of a nasty prison fight. If one of her boys found a fight in the neighborhood, there would be punishment if they started it. If they hadn’t, there would be a question.

“Did you win?” McFarlane would ask.

McBrayer learned to find his fights in another arena.

Using his length and speed, McBrayer has combined with guards Nate Mason and Kevin Dorsey to attack teams in transition and change the look of the Gophers offense when doing so. McBrayer capped a four-game stretch in which he’s averaged 11.5 points a game with a career-high 14 points against Rutgers on Tuesday. He added seven assists, the fifth time in the last eight games he’s notched four or more. In his past three games, he’s sunk six of nine three-pointers, flipping his old skid on its head.

“The more I play, the more the game slows down,” said McBrayer, who is averaging 5.9 points and 2.3 rebounds in 22.7 minutes a game. “It’s just being comfortable out there, basically … knowing when to make plays.”

Pitino has a simpler take: “Dupree is really getting better in front of our eyes,” he said after Tuesday’s win.

Back in Queens, McFarlane will host a “full house” during games, standing on her chair when she gets too excited, screaming at the screen.

“Yeah, baby!” she’ll yell.

The pride that extends from mother to son also flows the other way. A decade removed from that prison trip, McBrayer realizes everything his mother did to keep him safe and happy, working almost daily at Rikers Island to ensure he was provided for.

Now, he saves the money she and his father each send him periodically, using it to find ways to thank her.

For Thanksgiving, he sent her flowers. For Christmas, he said, beaming, he collected enough to buy her a Gucci bag.

It might have been enough to make a prison warden blush.

“She has two sides to her: She has a nice side, and she has a mean side,” McBrayer said grinning, a mouth full of braces exposed. “You mostly see the mean side, but when the nice side comes out, it’s pretty dope.”