Four straight defeats without scoring had severely dented the Swans' automatic promotion hopes and left them looking nervously over their shoulders at the teams trying to force themselves into the play-off reckoning.
Millwall were one of those teams, albeit with only a slim chance of gatecrashing the top six, and they were the form team going into this clash at The Den, having won their last three.
However, the Swans' confidence came flooding back after Ayew ended their goal drought just before half-time, with Lowe adding two goals after previously going 17 games without finding the net.
It came at the end of a week in which Swansea boycotted their social media channels after a number of players, including Lowe, were the target of racist abuse online.
Cooper said: "I thought we were a real attacking threat all game.
"I think Wayne (Routledge), coming into the team, was excellent, Andre has scored at a brilliant time, just before half-time, and he was a real nuisance for the Millwall defenders.
"He was taking up areas where he was perhaps not getting the ball, but he was dragging people out of areas to exploit spaces elsewhere.
"But Jamal, brilliant, two excellent goals. I haven't seen his chance back, but I could see he was in an excellent position in the first half and it's not affected him and he then scores two.
"To have a character like that is a sign of a really good player.
"Everybody contributed – you look at the back four, who were a real strong unit defensively, Freddie (Woodman) made an important save and his distribution was good."
Lowe had been denied by a good save from Millwall goalkeeper Bartosz Bialkowski by the time Ayew broke the deadlock in first-half stoppage time with a superb bending strike into the far corner.
Jake Cooper then struck the post for the Lions with a header just after the restart before Bialkowski pushed out a good effort from Routledge.
Lowe then ended his goal drought by running into the area off Routledge's clever pass before rifling his shot in at the near post.
Woodman made a superb save to prevent Kenneth Zohore from halving the Swans' lead and Lowe made sure of the result with five minutes left, converting from Ayew's cut-back.
With Millwall's play-off hopes now surely over, their manager Gary Rowett said: "I don't think we ever really focused on that, we never really looked at that as an option that's within our grasp.
"We just wanted to keep the season going and see if someone slipped up in those positions.
"We didn't do our bit, which was perform as well as we could.
"We knew it was a big ask, to go and beat Swansea, they're a good side, but I thought they played well today and if it means that, realistically, that gap is too big, we've just got to finish the season as strongly as we can.
"I spoke to Steve before and we both agreed that it's been a tough season in many ways, so I can forgive the players every now and then for maybe not performing at the same level that we have done in recent weeks."