German torpedo technology was behind that of Japan. German radio and radar technology was behind that of the UK (and we can thank Japan for coming up with one of the major breakthroughs in radar development, even though they lacked the industrial knowledge to use that technology). The UK led the world in computer development during the war, but then chose to classify everything related to it, resulting in the near-total shutdown of the UK's commercial computer development after the war. German nuclear technology was focused on a different branch than that of the US and UK (fusion versus fission), and ultimately ran into a dead end which the Germans could not solve in any reasonable timeframe without the American piece of the puzzle, although it led to the rapid development of a US fusion bomb after the war. German metallurgy (and practically everyone else's until at least the 1960s) was behind that of the Soviets. German internal combustion engine designs were behind those of the UK, leading to less powerful conventional aircraft and underpowered vehicles. German industry and factory design was decades behind, while Henry Ford helped turn both the Soviet Union and the US into cutting edge industrial powerhouses. The list goes on and on.
Germany put a lot of effort into a few long-shot programs, and made spectacular advances in a few narrow fields (at the expense of other fields) in hopes of fielding a war winning super-weapon. Those did not help win the war, costing a lot of time and effort on things which Germany ultimately couldn't afford to actually build or use, but which later significantly advanced the technologies of the countries which occupied it at the end of the war. Other German advances were "focused", very good at one particular function, but at the expense of other roles which it would need to fill. You can say that it did "x" better than anyone else's design, but it was still not an optimal choice overall. They did do a rather remarkable job in many cases (the reliable German MG-42 machinegun design was still in use as the imperfectly copied American SAW in Vietnam 25 years later) with the bad situation they were confronted with, and a few things were true marvels of technology (radio guided missiles, rocket engines), but there were also glaring mistakes and oversights, so overall their technology was probably about on par with the Allies. The material shortages made much of it a moot point. There's just something wrong with a team of horses pulling a rocket.
Note too that the US was fielding long-range submarines with fairly advanced capabilities against Japan, so Germany's actual lead was relatively slim, but there was never any point where late war German and US submarines could be directly compared under similar combat conditions. Their intended roles and operating conditions were different. Yes, the US did learn a few things from German U-boat design, thanks to a captured U-boat a bit earlier in the war (the US government eventually sailed it up the St. Lawrence Seaway, through the Great Lakes, to Chicago, and then hauled it inland by special multi-track rails to the Chicago Museum of Science and Industry), but that knowledge didn't have time to percolate into US designs before war's end. If the situation had been reversed, the Germans would have learned a few different things from the US.