Aidy Boothroyd's side fell behind to a Martin Chrien header in the first half.
Alfie Mawson scrambled in an equaliser before a powerful Nathan Redmond strike gave England victory.
The Three Lions are top of Group A on four points and will guarantee a place in the last four by beating hosts Poland in Thursday's final group game.
Only the winners of each of the three groups go through to the semi-finals, along with the best runner-up.
A 90th-minute Poland equaliser against Sweden in the other group game on Monday simplified the situation for England. If Sweden had held on for victory they would be level on points and goal difference ahead of Thursday's decisive fixtures.
Relive England's win against Slovakia
England reached the European Under-21 Championship final in 2009 but their record since has been hugely disappointing.
They failed to get out of the group stage in 2011 and 2013 and looked in real danger of another early exit after a drab first 45 minutes against Slovakia in Kielce.
After managing just one shot on target in the 0-0 draw with Sweden in their group opener, England again looked lightweight in attack. They were ponderous in possession and lacked invention.
Their chances of scoring appeared even more unlikely when Slovakia closed ranks after going ahead, Chrien's header looping over Everton's £30m goalkeeper Jordan Pickford.
But a half-time alteration brought with it a change of fortunes.
Norwich forward Jacob Murphy replaced Mason Holgate at right-back and within five minutes he produced the cross that led to Mawson's equaliser.
The goal resulted in Slovakia - looking for a win that would move them onto six points and in command of the group - abandoning their cautious approach in search of a winner and that played into England's hands.
A failed Slovakia attack led to England breaking three against two, and Redmond did well to cut inside his marker before driving an effort into the far corner with the help of a deflection.
It was a far from convincing England performance but nevertheless a satisfying result in an intimidating atmosphere.
England now have their destiny in their own hands - beat Poland on Thursday and they are into the last four.
However, it could have become very complicated if Sweden had held on to their 2-1 lead in the closing stages of the game against Poland.
If they had taken the three points in that game and both England and Sweden won their final group fixtures by the same scoreline they would both have been level on points, goal difference and goals scored.
That meant it would have been down to disciplinary points and, finally, coefficient ranking to determine the group winner.
As it was, Dawid Kownacki coolly converted an injury-time penalty to earn Poland a draw and keep the host nation's hopes of a place in the last four alive. They must beat England on Thursday to have a chance of progressing.
BBC Radio 5 live's chief football correspondent Ian Dennis:
I thought it looked bleak for England at half-time but to their credit they responded to the pressure to come from behind in their "must-win" contest and showed resilience to absorb late Slovakian pressure.
Aidy Boothroyd changed the system for this match and played with a diamond - and while England enjoyed a lot of possession I thought they still lacked penetration in the first 45 minutes and played in front of Slovakia, still struggling for creativity.
I know England were disappointed to concede the goal midway through the first half but I thought the central defensive pairing of Calum Chambers and Alfie Mawson were excellent, particularly in the second half.
The half-time change from Boothroyd paid dividends as substitute Jacob Murphy delivered a cross that was steered in by Mawson - and the change of system also saw Redmond involved more.
England crucially remain in contention to progress. I don't think we are yet to see a consistent performance over 90 minutes here in Poland and James Ward-Prowse told me after Monday's game that he feels they're yet to reach their full potential.
But remember, it's not how you start tournament football but how you finish and this victory, achieved under pressure, should be viewed as a real stepping stone.
England's final group game against Poland on Thursday will be live on BBC Radio 5 live
England Under-21 boss Aidy Boothroyd: "If we lost or drew the game we were out. So we had to be bold, keep ourselves in the mix. We did that. Now we've put this to bed we've got a really tough game coming up against Poland. We want to progress, we want to do well.
"Nervy? I think that's fair. The extra player in midfield was to make them less jittery and give them more of an option on the pitch.
"[Poland on Thursday] will be difficult. We've been welcomed into the city by our hosts and I'm sure it will be a good game and a good football match. We'll have to be at our best."
England Under-21 defender Alfie Mawson, on what was said at half-time: "It got a little bit heated, really. A lot of players were frustrated. I was so frustrated about the goal.
"But Aidy was calm and calmed everyone down. We said we needed to man up and do the right thing.
"Credit to us and we did what we needed to do. We don't take it in a negative way. We are all men about it. We could have easily crumbled at 1-0 down but we stood up and passed it with flying colours."
Slovakia Under-21 boss Pavel Hapal: "There were two individual errors which resulted in goals. England has a very strong squad but I'm proud of my team because we created great pressure the last 30 minutes.
"I'm not sure how often you see England trying to delay the game, which was the case here."
Match ends, Slovakia U21 1, England U21 2.
Second Half ends, Slovakia U21 1, England U21 2.
Lewis Baker (England U21) is shown the yellow card.
Hand ball by Lewis Baker (England U21).
Corner,  England U21. Conceded by Milan Skriniar.
Foul by László Bénes (Slovakia U21).
Lewis Baker (England U21) wins a free kick in the defensive half.
Substitution, England U21. Cauley Woodrow replaces Tammy Abraham.
Attempt blocked. Albert Rusnák (Slovakia U21) right footed shot from outside the box is blocked.
Corner,  Slovakia U21. Conceded by Lewis Baker.
Jacob Murphy (England U21) is shown the yellow card for a bad foul.
Foul by Jacob Murphy (England U21).
Lukas Haraslin (Slovakia U21) wins a free kick on the left wing.
Hand ball by Tammy Abraham (England U21).
Substitution, England U21. Demarai Gray replaces John Swift.
Nathaniel Chalobah (England U21) wins a free kick in the defensive half.
Foul by Pavol Safranko (Slovakia U21).
Delay over. They are ready to continue.
Delay in match Tammy Abraham (England U21) because of an injury.
Attempt blocked. László Bénes (Slovakia U21) left footed shot from outside the box is blocked.
Corner,  Slovakia U21. Conceded by Jacob Murphy.
Substitution, Slovakia U21. Lukas Haraslin replaces Jaroslav Mihálik.
Attempt missed. Albert Rusnák (Slovakia U21) right footed shot from outside the box misses to the left. Assisted by László Bénes.
Attempt saved. John Swift (England U21) right footed shot from outside the box is saved in the bottom right corner. Assisted by Nathan Redmond.
Tammy Abraham (England U21) wins a free kick on the right wing.
Foul by Milan Skriniar (Slovakia U21).
Substitution, Slovakia U21. László Bénes replaces Martin Chrien.
Substitution, Slovakia U21. Pavol Safranko replaces Adam Zrel'ák.
Robert Mazán (Slovakia U21) is shown the yellow card for a bad foul.
Jacob Murphy (England U21) wins a free kick in the defensive half.
Foul by Robert Mazán (Slovakia U21).
Attempt missed. Martin Chrien (Slovakia U21) left footed shot from outside the box is high and wide to the left.
Attempt blocked. Milan Skriniar (Slovakia U21) header from the centre of the box is blocked. Assisted by Albert Rusnák with a cross.
Corner,  Slovakia U21. Conceded by Ben Chilwell.
Goal!  Slovakia U21 1, England U21 2. Nathan Redmond (England U21) right footed shot from the left side of the box to the top right corner. Assisted by James Ward-Prowse.
Alfie Mawson (England U21) wins a free kick in the defensive half.
Foul by Matus Bero (Slovakia U21).
Attempt missed. Matus Bero (Slovakia U21) left footed shot from outside the box is close, but misses to the right. Assisted by Jaroslav Mihálik.
Attempt blocked. Robert Mazán (Slovakia U21) left footed shot from outside the box is blocked. Assisted by Stanislav Lobotka.
Attempt saved. Jacob Murphy (England U21) left footed shot from outside the box is saved in the centre of the goal. Assisted by Nathaniel Chalobah.
England are one win away from a place in the European Under-21 Championship semi-finals after coming from behind to beat Slovakia on Monday.