Sergio Aguero's equaliser seven minutes later seemed to have set them back on course as they dominated the opening half but the Bundesliga side, bold and enterprising, held on until Silva cashed in on a late defensive error.
The energy levels dropped a little after the break and the second 45 minutes were a cagier affair.
It looked as though City would come away with only a point for their troubles until, in the 87th minute, Silva pounced on an error from Stefan Posch before firing home the precious victor.
Pep Guardiola's men began the campaign with a 2-1 loss to Ligue 1 outfit Olympique at the Etihad on match day one.
Canada and the United States reach a deal on NAFTA
The US and Canada came to an agreement Sunday to tweak key pieces of the North American Free Trade Agreement, known as NAFTA . Reaching a deal would remove a key irritant in the trading relationship between the US and Canada, its top export market.
GOP chooses prosecutor Rachel Mitchell to ask questions at Thursday's Kavanaugh hearing
It was a crucial moment in Christine Blasey Ford's testimony Thursday before the Senate Judiciary Committee. Following Ford's hearing, Kavanaugh began his opening statement with a strong denial of the allegation.
GOP’s ‘Female Assistant’ Rachel Mitchell Pokes Holes in Her Own Cross-Examination
That continued Thursday, as women and men across the country watched and listened to the testimony and shared their own stories. Later, Mitchell pressed Ford repeatedly to reveal who paid for a polygraph exam that Ford took in the late summer.
From that point on, City were repeatedly thwarted in their efforts to grab a second goal against a dogged Hoffenheim side until Silva struck.
Back on the sidelines after serving a one-match ban against Lyon, Guardiola leapt off the bench in rage when City were denied a late penalty after Hoffenheim goalkeeper Oliver Baumann brought down Leroy Sane in the area.
The visitors were posing a constant threat on the break, Sane leading another rapid attack before Silva was driven wide by the final pass and his cross was blocked. They are certainly a team in form and are playing at home - it will certainly be a hard game for us.
In front of him, Fernandinho, David Silva and Bernardo Silva pick themselves given their current form, particularly the Portuguese playmaker.
But Bernardo Silva nearly conjured the goal that would have given the visitors the lead, crossing for Aguero whose header was clutched by Baumann.