The games are being developed by different teams.
http://www.nintendoworldreport.com/news/30541
Nintendo has revealed that the upcoming 3DS game New Super Mario Bros. 2 and the upcoming Wii U game New Super Mario Bros. U will not connect to each other, and are under development by two different teams.
There has been speculation on how the two games would relate to each other since both side-scrolling Mario games are believed to see release within months of each other later this year. This led to a question on the two games and Nintendo's development of them by Nintendo World Report's own Jonathan Metts at today's Wii U developer roundtable with Nintendo's Wii U Software Producer Katsuya Eguchi.
In addition to explaining that the two game's teams are not planning any sort of linkup between the two titles, Nintendo General Manager Takashi Tezuka explained that they are trying to make each game suit each hardware's individual strengths. Tezuka said that they would be talking about New Super Mario Bros. 2 for the 3DS at Nintendo's 3DS Software Showcase event tomorrow (June 6).