The Red Devils won 2-1 on the night, with two goals coming in extra-time injury time, but lost 2-1 on penalties, ensuring the Black Cats went through to Wembley to face Manchester City.
In the second half, the away side pushed for an equaliser, Adam Johnson driving the ball wide in the 53rd minute. Replays showed that it took a deflection off Michael Carrick, but the referee awarded a goal kick.
In an open-ended game, Antonio Valencia and Januzaj had further chances for the home side, while Marcos Alonso unleashed a powerful left-foot volley that flew wide of the far post with 10 minutes left to play.
With neither side able to make the breakthrough, the game went to extra time.
Sunderland thought they had won it after ex-United player Phil Bardsley scored right at the death, but Hernandez then struck a minute later to set up a penalty shootout.
With both sides missing several penalties, it fell to Johnson to put Sunderland through. Though he missed, Rafael da Silva fluffed his shot too, sending the Black Cats to their first cup final in 22 years.