This page explains in detail the interactions between the Donkey Kong series and the Lego City series.
Lego City Undercover
March 18, 2013

In the "Miner Altercation" level of the game, the player comes across an area based on the 25m level from Donkey Kong, consisting of sloping ramps and ladders. As the player traverses the area, Chase McCain, the game's protagonist even remarks: "I hope there isn't a giant ape at the top of this thing."
License
Lego City Undercover was published by Nintendo, so they could freely include references to Donkey Kong.