Dean Kremer allowed 1 run over 6 innings in his first start after nearly 2 1/2 months out, settling in after Sam Antonacci homered on his second pitch.
Baltimore had no hits through four innings before Tyler O'Neill's 430-foot solo homer tied it, then broke the game open with four fifth-inning runs.
Adley Rutschman's RBI single, Taylor Ward's sacrifice fly and a Trevor Richards wild pitch capped a bases-loaded rally, while Blaze Alexander later tripled and Leody Taveras added his third homer.
Defense helped preserve Kremer's return: O'Neill made a diving catch in right, and Rutschman threw out a runner to lift his caught-stealing rate to 37.5%.
The win left Baltimore 40-48 heading into a day off, though the finish was tempered by closer Ryan Helsley leaving his warmup with right elbow discomfort.