The Terps slugged seven doubles and four home runs in the win.
The Terps gave up seven runs in the third inning to fall into an early hole they couldn't climb out of.
The Terps gave up five runs in the first inning as they suffered their second loss of the season.
Bobby Zmarzlak's 10th-inning home run secured the victory for the Terps.
The Terps scored four-plus runs in five different innings.
Some late heroics by Kevin Keister, Luke Shliger and Nick Lorusso finished off the Retrievers and lifted the Terps to their 17th win.
After trailing for the majority of the game, Shaw came up with a big swing in the bottom of the ninth to secure the victory.
The Terps overcame a strong offensive day from the Rams to move to move to 10-2 on the season.
Lorusso's single pushed the Terps to 4-0 after a gritty win over the Retrievers.