His comments came as Merkel is emerging as the world leader most openly at odds with US President Donald Trump, saying days ago that Europe could no longer completely rely on traditional ally the United States and needed to find its own way.
Modi, on a Berlin visit kicking off a four-nation Europe tour, pledged India's commitment to democracy and a strong European Union, and argued that failing to act against global warming would be "a morally criminal act".
"We do not have the right to despoil the environment for future generations," he said in Hindi, at a joint press conference with Merkel.
Many of Modi's comments contrasted sharply with positions of Trump, who has denied climate change, criticized the EU, predicted more countries will leave the EU and spoken out against free trade while pushing an "America First" policy.
"We are all connected with one another," Modi said. "Democracy and diversity are the pillars of a values-based global order."
He added that "the international community really needs the chancellor's vision ... in terms of the great challenges," also including terrorism.
Merkel, who will host a G20 summit of the biggest developed and emerging economies in July, has long cultivated strategic relations with India, the world's biggest democracy and the rival Asian power to China, whose Prime Minister Li Keqiang will also visit Berlin this week.
Last Sunday - after a G7 summit in which Trump and the other six western powers again sparred on climate, defence funding and other key issues - Merkel said Europe could no longer completely rely on traditional allies the United States and Britain in the age of Trump and Brexit.
Standing beside Modi, Merkel said "India with its 1.25 billion people is a partner ... and of highest importance" and that "to work together with such a diverse country" also offered opportunities for German businesses.
She stressed that diplomacy is not a zero-sum game and that while Berlin was building strong ties with the rising Asian powers, transatlantic ties remained "of paramount importance".
'Impact whole world'
Modi's tour also leads him to Spain, France and Russia - but not to former colonial power Britain.
Britain, which is set to leave the EU by 2019, wants to boost trade with India, the world's fastest-growing major economy, which is meanwhile also trying to revive stalled, decade-old trade talks with the EU.
Modi and Merkel led a joint cabinet meeting grouping foreign, economy, environment and other ministers in their fourth intergovernmental consultations - a format Germany has only with a few countries, also
including China, Israel and France.
Both sides signed agreements in fields from sustainable urban development to vocational jobs training, digital technology and railway safety and agreed on German development aid and investments worth around €1 billion ($1.1 billion) a year.
Germany is India's largest trading partner in the EU, and more than 1,600 German companies with over 400,000 employees operate on the subcontinent.
Two-way trade has more than tripled over the past decade to over €17 billion ($19 billion), of which German exports make up almost €10 billion.
Modi wrote before his trip that "India and Germany are large democracies, major economies and important players in regional and global affairs".
"Our strategic partnership is based on democratic values," he wrote in a Facebook entry, contrasting India with the one-party state China.
A German foreign ministry spokesman, Martin Schaefer, stressed that India enjoys rapid economic growth and development and "will soon be the most populous country on Earth".
"Everything that happens in India - politically, economically and socially - has, because of the country's size and importance, a direct impact on the whole world, including us."
By Frank Zeller