Sunderland led Hull 2-1 at the break after an end-to-end first half.
Lee Johnson made two changes to the Black Cats side that were beaten by Blackpool at the weekend.
Aiden McGeady missed out due to a swollen foot and Aiden O'Brien dropped to the bench. Lynden Gooch and Carl Winchester came into the starting XI against the Tigers.
Sunderland took the lead when Gooch did brilliantly to win the ball then cross for Jordan Jones, who finished with a well-placed volley.
However, the home side levelled when Wilks beat Callum McFadzean too easily on the right, and Magennis was unmarked to head home from close range.
But the Black Cats were ahead again just minutes later when Elder was adjudged have handled the ball in the box, and Grant Leadbitter made no mistake from the spot.
Here's how James Hunter has rated the players so far.
LEE BURGE 7
Made one very good save from Lewis-Potter and a routine one from Wilks, but had no chance with the goal
MAX POWER 7
Has linked up well with Gooch down the right
BAILEY WRIGHT 5
Didn't track Magennis' run for the goal
LUKE O'NIEN 6
Generally looked solid alongside Wright
CALLUM McFADZEAN 5
Should have done more to stop the cross for the Hull goal
CARL WINCHESTER 6
Worked hard in central midfield and hasn't let Hull settle on the ball
GRANT LEADBITTER 7
Anchored the midfield, and showed nerves of steel to convert the penalty
LYNDEN GOOCH 8
Caused all kinds of problems on the right, providing the assist for Jones, almost setting up another for the same player, and winning the penalty
JOSH SCOWEN 7
Playing in a slightly more advanced role and has shown some neat touches
JORDAN JONES 8
Scored the opening goal, and had headed against the woodwork just a minute earlier
CHARLIE WYKE 6
Won plenty of aerial duels