The Serb came through 7-5 4-6 7-6 6-7 6-3 after four hours and 49 minutes of tennis.
There was little to separate the two players in the early stages of the opening set, with both holding serve well. However, an unforced error from Del Potro allowed Djokovic to break for 7-5 and claim the first set.
The second set followed a similar pattern early on, but it was Del Potro who made the crucial break in the eighth game after moving three break points ahead on the Djokovic serve. The Argentine held his nerve to serve out the set 6-4.
Both players continued to dominate on their own service games in the third set. However, with the score at 6-5, Del Potro fought back to save three set points on his service game to take it into a tie-break, which Djokovic claimed 7-2.
The fourth set also went to a tie-break, where Djokovic let two match points slip before Del Potro won it 8-6 to take the match into a deciding set.
The world number one got the crucial break in the eighth game of the final set to move 5-3 up, before serving out the match to progress to his second Wimbledon final.