Inter had failed to win their last eight league matches, plus two more in the Coppa Italia, since thumping Chievo 5-0 on Dec. 3 and their previous five outings in Serie A had ended in 1-1 draws.
The win took Inter third although there is a huge 14-point gap between themselves and Juventus above them.
The video replay system (VAR), being trialled in Serie A and other competitions, was involved in more controversy at Torino where visitors Udinese had a goal controversially disallowed on their way to a 2-0 defeat.
Eder gave Inter a perfect start at San Siro by turning in Marcelo Brozovic’s pass in the second minute but, as so often this year, the hosts shot themselves in the foot.
Inter defender Miranda made a hash of a clearance and allowed Rodrigo Palacio to nip in and equalise against his old club in the 25th minute.
Inter missed two excellent chances after halftime and their frustration showed when Brozovic was substituted, jeered off the field and responded by sarcastically applauding the San Siro crowd.
But the mood changed completely thanks to 19-year-old Karamoh who played a one-two with Rafinho, slipped past two defenders and fired a 25-metre shot past Mirante in the 63rd minute. It was the Frenchman’s first goal in Serie A following his move on loan from Caen in August.
Bologna defender Ibrahima Mbaye was sent off after being booked twice in four minutes although the visitors still gave Inter a jittery finale and had a penalty appeal turned down after the referee reviewed the incident using VAR. The referee also used VAR to dismiss Adam Masina for a reckless challenge in stoppage time.
Antonin Barak thought he had given Udinese the lead at Torino in the 20th minute but, after taking several minutes to review the incident with the VAR, the referee disallowed the effort for a push by Maxi Lopez. Torino took advantage to win with goals from Nicolas N’Koulou and Andrea Belotti, the Italy forward ending a two-month drought by running from inside his own half to score a superb solo effort.
Uruguayan Diego Laxalt scored a late winner for Genoa for the second match in a row to give them a 1-0 win at Chievo while Edgar Barreto and a Fabio Quagliarella penalty gave Sampdoria a 2-0 win over Verona.