The Arizona Cardinals ended a five-game losing streak by beating the Dallas Cowboys 27-17 on Monday night.