Sheffield United lost any chance of staying in the top flight after a 1-0 defeat by Wolverhampton Wanderers in the previous round but they left struggling Brighton with work to do if they are to avoid joining them in the Championship.
The result left the Seagulls 16th on 34 points from 33 games, seven ahead of 18th-placed Fulham who occupy the final relegation spot with five games remaining. Sheffield United stayed bottom on 17 points.
McGoldrick netted in the 19th minute after Brighton's defence failed to clear the danger and the home team's striker beat goalkeeper Robert Sanchez with a smart left-footed shot on the turn from eight metres.
Sheffield goalkeeper Aaron Ramsdale twice denied Neal Maupay, who also skied a shot from three metres with the goal at his mercy after Brighton midfielder Jakub Moder had a goal disallowed for offside in the build-up.