Costes launched his seventh homer of the season to boost the Terps toward a second victory over the Hoyas.
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' loss to the Pirates was plagued with small mistakes and missed opportunities.
The Terps overcame a strong offensive day from the Rams to move to move to 10-2 on the season.
The Terps were unable to quell the Pirates after stranding multiple runners in pivotal moments in the game.
The Terps scored three runs in the fourth inning to reinsert themselves into the game, and quickly pulled away soon after.
The Wolverines cracked a three-run homer to take the lead from the Terps and never looked back.
The Terps will have a 2021 Greenville Regional rematch with East Carolina along with their first matchup against Michigan over the weekend.
A barrage of offense pushed the Terps to their eighth straight win to open up the spring 2022 season.