But although Derby were defeated 3-1, Sunderland failed to take advantage and were beaten by George Byers's 52nd-minute header.
Byers had hit the post with a free-kick before the break, while Sunderland goalkeeper Max Stryjek made a good save to deny Liam Cullen.
The victory for Swansea meant they finished fourth in their first season in Division 1. Sunderland are relegated in 11th, two points ahead of bottom-club Manchester United.
Swansea: TBC v Sheffield United (H) PL Cup