He gave up seven hits, including two homers. Roark hadn't allowed more than one home run in a game since that May 3 game against the Phillies.
"They're in first place for a reason," he said of the Orioles. "They hit the ball, and they showed it tonight."
Wilson Ramos put the Nationals up 1-0 in the second inning with his first home run since July 9, against the Orioles.
Joseph homered in the third, the first run against Washington in 23 innings. In the bottom half, Jayson Werth hit a sacrifice fly after a double by Denard Span, who has reached via a hit or walk in 30 straight games.
Markakis made it 3-2 in the fifth with his 10th home run, matching his total of last season.
Orioles: Right-hander Ubaldo Jimenez (right ankle sprain) has completed his rehabilitative work in the minors and could be activated from the DL as soon as Friday.
Nationals: Washington placed outfielder Nate McLouth on the 15-day disabled list with right shoulder inflammation. Outfielder Steven Souza Jr. was recalled from Triple-A Syracuse.
Orioles: Baltimore will start right-hander Bud Norris on Tuesday night in Toronto. He's 2-0 with a 1.83 ERA against Toronto this season.
Nationals: Gio Gonzalez (6-7) starts Tuesday for Washington in the opener of a three-game series against the New York Mets, who are 1-5 against the Nationals this year.
Released by Oakland over the weekend, former Orioles right-hander Jim Johnson worked out for Baltimore at the team's training complex in Florida.
If signed by the Orioles, Johnson would likely receive a minor league deal.
"He's certainly got a good pedigree and history of having success," Showalter said. "He's got himself a tough decision to make, but a good one. He's got some people interested in him."