Dumfries missed an open header in the first half, but he converted when the team needed it most, heading to a Nathan Ake cross just minutes after his team lost a lead by two goals.
The Dutch were playing in their first major football tournament in seven years. The last time was at the 2014 World Cup in Brazil, when they reached the semi-finals.
Georginio Wijnaldum put the 1988 European champions in the lead in the 52nd minute, and Wout Weghorst made it 2-0 in the 59th.
But Ukrainian captain Andriy Yarmolenko curled a shot on Maarten Stekelenburg in the 75th minute and Roman Yaremchuk dived past Weghorst to head a left free kick four minutes later.
Ukraine, which is in its third European Championship, has won only one match and has never left the group stage.
Around 16,000 fans, all of whom had to show a negative COVID-19 test to enter, watched the Netherlands dominate the game at the Johan Cruyff Arena until Ukraine’s unlikely return.
The Netherlands will face Austria on Thursday, while Ukraine will play North Macedonia in Bucharest. Austria beat North Macedonia 3-1 in a previous Group C game.