Joachim Low's world champions went ahead through Mario Gomez's penalty after 13 minutes.
But Slovakia, who are in the same group as England and Wales in France, hit back through Marek Hamsik, Michal Duris and Juraj Kucka in Augsburg.
The game was played in heavy rain with concerns the match might be abandoned.
Germany, who are in the same group as Northern Ireland at Euro 2016, have to finalise their 23-man squad by midnight on Tuesday.
Elsewhere, Euro 2012 winners Spain continued their preparations for the defence of their title with a 3-1 win against Bosnia-Herzegovina in Switzerland.
Celta Vigo forward Nolito scored the opening two goals for Vicente del Bosque's side.
Chelsea midfielder Pedro added a late third after Emir Spahic, who was later sent off, had reduced the deficit for Bosnia.
Spain gave a debut at right-back for Arsenal's Hector Bellerin.
Southampton's Graziano Pelle scored the only goal as Italy beat Scotland 1-0 in Malta, while Portugal - who meet England at Wembley on Thursday - were 3-0 winners at home to Norway.

The Manchester United forward, 30, scored seven goals in their Euro 2016 qualifying campaign, but has not played since a knee injury in February.
The top two scorers in this season's Premier League are both England strikers, Harry Kane and Jamie Vardy.
"Over the past two years my form for England has been really good. I've scored a lot of goals," Rooney said.
"I'll keep trying to, first and foremost, help the team be successful and if I can score the goals to help achieve that then that'll be great.
"I've still got a few years left, I feel," he told the PFA's 4 The Player magazine. "I'm always just thinking about what comes next and making sure I'm at my best for the summer.
"I feel I'm a lot more patient now in my play. When I was younger I could be impatient and I'd end up in positions I didn't really need to be in."

The 77-year-old retired farmer lives alone in his isolated rural cottage at Aughabrack near Dunamanagh.
Neighbours heard him calling for help at about 20:00 GMT on Sunday.
Two men rushed to help and used their car to block the gang's vehicle. As they approached, three men came running out, their faces masked by scarves.
"All I saw was the barrel of the shotgun being pointed at us. One of the gang was shouting; 'Shoot them, shoot them'," one of the neighbours said.
As the men withdrew, the gang managed to escape. The two neighbours gave chase before losing them on country roads.
They returned to the house to find the elderly farmer badly shaken.
It is understood he suffered serious burns to his arm when he tried to throw boiling water at his assailants. He had also been threatened with a knife.
It's understood the shotgun used by the gang to threaten the neighbours belonged to the farmer. It was loaded.
The pensioner is staying with relatives.
Police are seeking information about a Seat car used by the gang. A Seat Toledo car CKZ 8800 was found burnt out at Daisyfield Park off the Letterkenny Road, Londonderry early on Monday.
SDLP councillor Patsy Kelly described the gang who carried out the attack were "cowards".
Germany suffered a third defeat in four games as they were beaten 3-1 by Slovakia in the final match before their Euro 2016 squad is finalised.
[NEXT_CONCEPT]
England captain and record goalscorer Wayne Rooney is confident he has "a few years left" at international level.
[NEXT_CONCEPT]
A gang of men who assaulted a County Tyrone pensioner during a robbery threatened to shoot two neighbours who came to his aid.