The loss dropped Boston's record to 41-28 and let Baltimore (39-29) pull to within 1 1/2 games in the American League East.
In one of his best starts of the season, Dempster (4-7) gave up two runs on five hits and fell just one out short of a complete game. The Red Sox may have lost, but Dempster's ability to go so deep into this contest could prove valuable in the coming days, as the bullpen needed to throw only three pitches.
The relief corps desperately needed that break.
"Ryan did an outstanding job," manager John Farrell said. "Ryan gave us everything we needed here tonight."
Dempster struggled at first, giving up two runs on four hits in the first three innings, but he settled down after that, allowing only one hit in the final 4 2/3 innings.
"I felt better as the game went along, so that's always a good thing," Dempster said. "For me, it's not about me, it's about us as a team, and we're just trying to win games however we can get them. I felt good about my outing. I felt like I pitched well."
The Red Sox called up Rubby De La Rosa from Triple-A Pawtucket on Friday for an extra arm in the bullpen, but all they needed were the three pitches Uehara used in the eighth to strike out J.J. Hardy and end that inning.
"Ryan did a great job, threw a great game," catcher David Ross said. "That was a huge, huge performance."
But Dempster's performance wound up as kind of a hollow victory, as the Red Sox managed only three hits. They went into the game tied with the Orioles for the second-best batting average in the American League (.272), but the offense was quiet all night.
The Red Sox couldn't get going thanks mainly to Orioles right-hander Chris Tillman (7-2), who battled some control issues early but eventually went six-plus innings, giving up the three hits and striking out three. He did issue four walks, which helped give the Red Sox some scoring chances, but they couldn't come through.
The Red Sox finished just 1-for-7 with runners in scoring position and left seven on base, with Tillman escaping jams in the first and fourth.
"You've got to be careful," Orioles manager Buck Showalter said. "Every spot in their lineup has potential. You can't ever drop your guard, and I think, more than anything, Chris doesn't do that. He keeps pitching."
The Red Sox could have taken an early lead but were unable to get a key hit after putting two on with two outs in the first. Instead Mike Carp hit a long fly to right that Nick Markakis caught just in front of the fence.
Dempster gave up a one-out double to Manny Machado in the bottom of the first but retired the next two batters. He wasn't as lucky in the second, when Chris Davis lined a leadoff homer to left that gave the Orioles a one-run lead.
Baltimore made it 2-0 in the third on Adam Jones' two-out infield single. Third baseman Will Middlebrooks grabbed the ball with his bare hand and quickly threw it to first, but just late, allowing Nate McLouth to score from third.
The Red Sox wasted an even better opportunity in the fourth. Carp led off with a walk and later reached third when Jose Iglesias reached on a perfect one-out bunt single, but Tillman got Middlebrooks on a fly ball to shallow right and struck out Ross to preserve the two-run lead.
Boston's offense faded late, as Baltimore pitchers retired 16 of the final 18 batters they faced. Iglesias continued his recent tear, though, going 2-for-4. He's now batting . 451 and has a 15-game hitting streak.
However, Jim Johnson closed it for Baltimore when he got Iglesias to ground into a game-ending double play.