Let's say a teammate is invisible and within 5' of a creature, but not attacking it (and therefore maintaining invisibility). Would a Rogue be able to deal sneak attack damage to that creature every round by shooting arrows?
You don’t need advantage on the attack roll if another enemy of the target is within 5 feet of it, that enemy isn’t incapacitated, and you don’t have disadvantage on the attack roll.
The creature is an enemy within 5 feet and not incapacitated; providing you don't have disadvantage you can sneak attack.
The invisible person can move and take any available action, including Help to give the Rogue advantage. Assuming the Invisibility is from or similar to the Invisibility spell, if they attack or cast a spell they become visible but not otherwise.
The relevant parts of sneak attack (PHB p. 96) are,
"...you know how to strike subtly and exploit a foe's distraction."
"You don't need advantage on the attack roll if another enemy of the target is within 5 feet of it..."
This leads us to a couple of cases:
1. Your invisible friend is simply hiding out, being invisible, and your foe doesn't even know they are there.
No sneak attack. Your foe isn't being distracted by your friend so there is nothing for you to exploit.
2. Your invisible friend is standing by your foe and saying mean things to them lowering their morale
Sneak attack! Your foe is distracted by their cruel words and you know how to exploit it. Your friend could also be really laying in the nasty comments (So many nasty comments that they are using the Help action to make them all) and then you would also have Advantage on your attack.