Peru made the earlier forays, as they were the busier of the two outfits from an offensive point of view. The first effort on goal came from Christian Ramos who fired straight at Kasper Schmeichel.
Schmeichel showed goalkeeping class after punching clear a shot on the curl from Andre Carrillo after the 10th minute mark.
The Danes first shot on goal, rather in anger came after 25 minutes of play after Thomas Delaney fired way over the top.
On 27 minutes, Peru threatened once again as dangerman Jefferson Farfan got goal side for the first time in the game but his efforts to take a shot was blocked timeously by Simon Kjaer.
10 minutes to halftime, Denmark were forced to an early change as William Kvist made way for Jansen Schun disrupting to a degree their game plan.
The substitute wasted no time getting stuck in after firing in a shot off a free-kick by Christian Eriksen that bounced off the wall.
The South Americans were awarded a penalty after Christian Cueva was fouled in the box. Bakary Gasama waved away the initial appeal, but reversed his decision after VAR consultation.
It was left to Cueva who earned the spot kick to put them ahead, but to his and their entire nation dismay fired high into the evening Saransk sky.
Good work and intelligent play from Cueva where he evaded two defenders set-up Carillo who fumbled on his path to taking a shot at goal which left Edison Flores as the only candidate, but he too failed.
As per norm in football, you get punished for failure to take your chances. It happened to them after Yussuf Yurary Poulsen ran onto a through pass from Eriksen to beat Pedro Gallesse in the 59th minute.
Peru nearly pulled level a minute from going behind after Flores got at the end of a three-man counterattack, but a brilliant one-handed stop from Schmeichel kept him out.
The revered Peruvian Paolo Guerrero came on at the midway point for his World Cup debut. His first piece of action was when he was unable to beat Schmeichel with a close-range header following a cross.
Later, a clever-thinking back-heel did little to aid them to go in front as the ball trickled just aside of goal on 79 minutes.
A cross-field pass from the right picked out Farfan whose first-time shot was cleared off the line by foot from Schmeichel.
Eriksen were then handed an inviting opportunity to put the game to bed, but after getting goal-side from the left, shot straight at Gallesse who stood firm to pull off the save, as they leave with the points.