Sosa picked up the listless Orioles with a two-run homer, Lopez rebounded nicely from his worst start of the season and Ryan got four outs in a 4-1 victory over the Los Angeles Angels on Thursday, snapping Baltimore's season-worst eight-game losing streak.
"I was surprised when I walked in here today and found out," Sosa said. "Mr. Mazzilli was great to me. I feel sad about what happened to him, and I wish him the best. But nobody's quitting in here. We're going to be all right."
It's been a miserable week for the Orioles, who lost star slugger Rafael Palmeiro on Monday after he tested positive for steroids. He still has six days left on his suspension.
But Sam Perlozzo won his first game after being promoted from bench coach to interim manager. His first three seasons as a major-league coach coincided with Mazzilli's final three seasons as a player, when both were with the New York Mets from 1987-89.
"It's a bittersweet day," said Perlozzo, reiterating one of his pregame remarks. "I never wanted to have a job at the expense of somebody else, especially a good friend like Lee Mazzilli. I'm very thankful that Maz kept me here for two years. He could have fired me, but he didn't.
"At the same time, I'm happy that I have an opportunity and I hope to make the best of it. But the team needed a win more than I needed a win. Trust me. I guess I should go thank Sammy for the home run, shouldn't I?"
Lopez (10-6) threw 94 pitches in five innings, allowing a run and two hits while striking out five and walking two. The right-hander was working on three days' rest after yielding eight runs in 1 1/3 innings last Sunday at Camden Yards against the White Sox.
"I heard the news about (Mazzilli) when I came in here, and I don't feel good about it," Lopez said. "But the bottom line is, we're professional players and we have a job to do.
"I was pretty surprised, but I had enough time to realize what happened. And once I got onto the field, I was just trying to concentrate on doing my job. I didn't have my best stuff today, but I battled all the way through."
Jorge Julio took over for Tim Byrdak with two on and two outs in the Angels' eighth and walked Juan Rivera, loading the bases. But Ryan struck out pinch-hitter Jose Molina to end the threat, then finished for his 23rd save in 27 attempts.
Rookie Ervin Santana (6-5) allowed four runs -- two earned -- and four hits over seven innings while tying his career high with seven strikeouts. The right-hander, who won his previous three starts, is 0-4 with an 11.34 ERA in four daytime starts compared to 6-1 with a 2.74 ERA in eight starts at night.
Sosa's 14th homer this season and the 588th of his career increased Baltimore's lead to 4-0 after Eric Byrnes drove in the first two runs in the third. Sosa drove a 2-0 pitch into the left-field bullpen in the fourth inning after Javy Lopez was hit by a pitch.
Despite his two hits, Sosa is batting a measly .239 with 40 RBI in 87 games -- not the numbers usually associated with a seven-time All-Star and baseball's fifth all-time leading home run hitter. His first homer since July 27 came too late to help Mazzilli.
"Nobody worked harder than Maz," Angels manager Mike Scioscia said. "I know he worked very, very hard at getting that team and their whole organization going in the right direction. But when it doesn't happen, you're accountable. That's the life of anybody who's in this position. If you're not moving the organization forward, they make you pass the baton to somebody else."
Byrnes hit a pop fly to short left field, and the ball fell for a triple as shortstop Orlando Cabrera failed to make an over-the-shoulder catch in front of Garret Anderson near the foul line. A two-base error by Gold Glove first baseman Darin Erstad on Jay Gibbons' grounder made both runs unearned.
Erstad left after six innings because of inflammation in his right hip. He felt discomfort after catching a popup by Javy Lopez in the middle of the diamond and stumbling off the pitcher's mound. His error came one inning later.
"The popup was in no man's land. I've got the largest glove, so I figured I would be the guy to catch it," Erstad said. "I turned my ankle when I stepped on the mound and jammed it pretty good. It spasmed, so I had a tough time on defense, but it's nothing serious."
Vladimir Guerrero drove in the Angels' run with a fourth-inning single that followed Erstad's one-out triple. The RBI was Guerrero's 36th in 33 games and 73rd this season. The reigning AL MVP had eight RBI during the three-game series.
- Baltimore was 78-84 last year in Mazzilli's first season as a big-league manager, and 51-56 under him this season. No Orioles manager has lasted more than three full seasons since Hall of Famer Earl Weaver ended a 14-year run in 1982.
- Sosa has five homers in 104 career at-bats against the Angels. The other four came during his three seasons with the White Sox.
- Chone Figgins was 0-for-5 with three strikeouts for the Angels, ending his career-best hitting streak at 13 games.