LOS ANGELES -- The 49ers’ defense has taken on the personality of its coordinator.

The unit plays with energy and passion, much the same way that fist-pumping Robert Saleh coaches from the sideline.

On the field Sunday, D.J. Jones and others in the middle of the 49ers’ defensive line twice stacked up Los Angeles Rams running back Malcolm Brown at the goal line during a key sequence late in the first half. As the 49ers reacted with jubilation on the field, they were greeted by Saleh going wild on the sideline.

“I’m not going to lie,” Saleh said afterward, “I black out during those moments. I get excited for the guys and their success. When they make big plays, I feel like I’m right there with them.

“When we fail, I’m right there with them, too. So, we’re always together.”

There have been no failing grades for the 49ers’ defense during the team’s five-game win streak to open the season. The defense has led the way, and on Sunday, they provided all the momentum necessarily when they buckled down for an impressive goal-line stand to highlight the 49ers' 20-7 victory over the Rams at Los Angeles Memorial Coliseum.

“It was huge -- huge,” 49ers linebacker Fred Warner said. “Any time we get a fourth-down stop, we treat that like a takeaway. It gives the offense energy, too. That was a big play.”

The 49ers’ defense was at their best on third and fourth downs. The Rams failed to convert on any of their nine third-down plays. They were 0-for-4 on fourth downs.

The Rams, playing without star running back Todd Gurley, leaned on Brown and rookie Darrell Henderson for their running game. Henderson gained 22 and 14 yards on back-to-back runs, as the Rams looked to break a 7-7 tie in the second quarter.

After Richard Sherman tackled Henderson at the 1-yard line on a second-and-5 run play, Jones and Kwon Alexander stacked up Brown for no gain on a third down. Rams coach Sean McVay opted to go for it on fourth down.

Jones and Arik Armstead teamed up for the fourth-down tackle of Brown, thwarting the Rams’ last best scoring chance. Jones didn’t even know how big of a play it was at the time.

“To be honest, I didn’t know it was fourth down because they were running that hurry-up and I didn’t get a chance to look up at the scoreboard,” Jones said. “It just feels good to be out there and know that 10 other guys have your back.”

Each time, the 49ers could look to the sideline to see their leader, Saleh, and his unmistakable shiny bald head, reacting with delight, reveling in the successes of the defense.

“Any time we get off the field, he’s pretty hyped,” Warner said.

“It’s awesome,” 49ers defensive lineman Solomon Thomas said. “Coach is a genius. He has a defensive football mind, and he loves to communicate with the players and understand what we’re seeing and getting everything into place. It’s special to play for him.”

Said defensive lineman Arik Armstead: “I notice him every now and then. It gets us fired up. He’s the leader of our defense from a coaching standpoint. To have him fired up and excited about what we’re doing on the field is a great feeling.”

Saleh came under fire the past two seasons for the 49ers’ defensive woes. Last year, the team set all-time NFL records in futility after generating just seven takeaways, including two interceptions. The 49ers won just 10 games in the first two seasons with Saleh serving as coach Kyle Shanahan's top defensive coach.

Shanahan had to answer questions over those first two seasons about whether he'd consider firing Saleh as defensive coordinator. Shanahan remained a staunch supporter, and now he's answering questions about whether he might lose Saleh after this season to a head-coaching opporunity.

“The energy is infectious,” Thomas said. “It’s amazing to be out there. You feel like everybody has this swag to them.

"We go out there and play our game. We know how good we can be, so every time we have a chance to go out there, we can set a new standard for how good we are.”

[RELATED: How 49ers locked in after allowing early TD]

The 49ers put together a defensive masterpiece to shut down Rams quarterback Jared Goff. Veteran cornerback Richard Sherman issued praise afterward for a long list of players and assistants, including safeties coach Daniel Bullocks and defensive backs/passing game coordinator Joe Woods.

“We just go out there and execute and play at a high level,” Sherman said. “Another testament to Saleh, and DB and Joe Woods, because they came up with an incredible game plan, very sound, and we executed.”