The Slovaks took the lead in the 18th minute through a Wojciech Szczesny own goal.
Robert Mak cut into the box, leaving two Polish defenders in his wake before trying to beat the Polish goalkeeper at the near post. There was an element of luck as the ball bounced off the upright and then the back of Szczesny's head before nestling in the back of the net.
The goal was unfortunate for Poland, who dominated possession in a free-flowing first half. However, they were hampered by a lack of creativity in the box, with Robert Lewandowski largely being absent.
Poland came out in the second half with greater attacking purpose and intensity though, and they only had to wait 32 seconds before netting the equaliser - with their first shot on target. After a neat one-touch passing move which sliced open the Slovak defence, the ball fell to Karol Linetty, who scuffed his shot from eight yards out, but still managed to beat Martin Dubravka.
Poland weren't in the ascendancy for long though as they were reduced to 10 men in the 62nd minute after Grzegorz Krychowiak picked up a second yellow card for standing on Jakub Hromada's foot when attempting to make a tackle.
With a one-man advantage, it only took Slovakia seven minutes to retake the lead. The ball was whipped into the Polish box from a corner, with it being cleared to Milan Skriniar on the edge of the area. His first touch to bring the ball down was exquisite, before he rattled it beyond the despairing Szczesny.
Lewandowski was more lively in the second half and had an excellent chance to equalise just before the full-time whistle. However, he jumped too early when trying to connect with a corner, seeing the ball skim off the top of his head.
Jan Bednarek also had a chance to score late on, but he could only fire his shot wide after an initial attempt was blocked.
You can read the full match report on our sister site Football365 here.
Stat of the day
According to OptaJoe, Szczesny is the first goalkeeper to score an own goal in the European Championships.
What's next for Poland and Slovakia?
Slovakia will stay in St Petersburg for their next game, which is against Sweden at 2pm BST on Friday. A win in this fixture should guarantee their progression from the group.
Things don't get any easier for Poland, who will face the strongest side in the group, Spain, at 8pm on Saturday. The game will take place at Sevilla's Estadio La Cartuja, effectively making Spain the home side.