Heat a large skillet over medium heat. Cook bacon until crisp. Remove with a slotted spoon and drain on paper towel. Reserve 2 tablespoons fat in pan.
Add onions to pan and cook over medium heat until deep golden brown, about 20 minutes.
Meanwhile, heat a large pot of water to boiling while preparing gnocchi.
Combine potato flakes, cheese, flour, salt, and pepper in a large bowl. Whisk together egg, butter and 1 cup water in another bowl. Pour over dry ingredients and mix lightly with a fork until a dough forms.
Knead dough gently, turning a few times on a lightly floured surface. Divide into four equal pieces. Roll into ropes about 20 inches long and cut into 1-inch pieces. If desired, roll the tines of a fork along gnocchi to add ridges.
Add half the gnocchi to the boiling water and simmer 3 minutes. Gnocchi should rise to the surface. Remove with a slotted spoon and transfer to the pan with onions. Repeat with remaining gnocchi.
Stir gnocchi and onions gently and top with crisped bacon.
Serve immediately with dollops of sour cream.